Fix regex detection. Fixes #1663 (#1696)

This commit is contained in:
Dominic Wong
2020-06-10 11:18:03 +01:00
committed by Vasiliy Tolstov
parent 750283cefd
commit a1d60688e1
2 changed files with 35 additions and 1 deletions

View File

@@ -188,7 +188,7 @@ func (r *registryRouter) store(services []*registry.Service) {
for _, p := range ep.Endpoint.Path {
var pcreok bool
if p[0] == '^' && p[len(p)-1] != '$' {
if p[0] == '^' && p[len(p)-1] == '$' {
pcrereg, err := regexp.CompilePOSIX(p)
if err == nil {
cep.pcreregs = append(cep.pcreregs, pcrereg)