diff --git a/internal/config/service.go b/internal/config/service.go index da953c0..1b84dc7 100644 --- a/internal/config/service.go +++ b/internal/config/service.go @@ -45,7 +45,17 @@ type BraceCapture struct { // Match returns if this service would handle this HTTP request func (svc *Service) Match(req *http.Request) bool { - return req.Method == svc.Method && svc.matchPattern(req.RequestURI) + var ( + uri = req.RequestURI + queryIndex = strings.IndexByte(uri, '?') + ) + + // remove query part for matching the pattern + if queryIndex > -1 { + uri = uri[:queryIndex] + } + + return req.Method == svc.Method && svc.matchPattern(uri) } // checks if an uri matches the service's pattern