Rearrange rules for matching strict slash

This commit is contained in:
Felipe Madrigal
2014-09-26 00:20:46 -05:00
parent 8df3a80fb8
commit d7e4639818

View File

@@ -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.