diff --git a/regexp.go b/regexp.go index 35c8177..a630548 100644 --- a/regexp.go +++ b/regexp.go @@ -35,12 +35,13 @@ func newRouteRegexp(tpl string, matchHost, matchPrefix, matchQuery, strictSlash defaultPattern := "[^/]+" if matchQuery { defaultPattern = "[^?&]+" - matchPrefix, strictSlash = true, false + matchPrefix = true } else if matchHost { defaultPattern = "[^.]+" - matchPrefix, strictSlash = false, false + matchPrefix = false } - if matchPrefix { + // Only match strict slash if not matching + if matchPrefix || matchHost || matchQuery { strictSlash = false } // Set a flag for strictSlash.