Browse Source

Rearrange rules for matching strict slash

Felipe Madrigal 11 years ago
parent
commit
d7e4639818
1 changed files with 4 additions and 3 deletions
  1. +4
    -3
      regexp.go

+ 4
- 3
regexp.go 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.


Loading…
Cancel
Save