|
|
|
@ -34,7 +34,7 @@ func newRouteRegexp(tpl string, matchHost, matchPrefix, matchQuery, strictSlash |
|
|
|
// Now let's parse it.
|
|
|
|
defaultPattern := "[^/]+" |
|
|
|
if matchQuery { |
|
|
|
defaultPattern = "[^?&]+" |
|
|
|
defaultPattern = "[^?&]*" |
|
|
|
} else if matchHost { |
|
|
|
defaultPattern = "[^.]+" |
|
|
|
matchPrefix = false |
|
|
|
@ -89,6 +89,9 @@ func newRouteRegexp(tpl string, matchHost, matchPrefix, matchQuery, strictSlash |
|
|
|
if strictSlash { |
|
|
|
pattern.WriteString("[/]?") |
|
|
|
} |
|
|
|
if matchQuery && len(idxs) == 0 { |
|
|
|
pattern.WriteString(defaultPattern) |
|
|
|
} |
|
|
|
if !matchPrefix { |
|
|
|
pattern.WriteByte('$') |
|
|
|
} |
|
|
|
|