diff --git a/web/pattern.go b/web/pattern.go index 0b17e64..be4ef34 100644 --- a/web/pattern.go +++ b/web/pattern.go @@ -174,9 +174,11 @@ func (s stringPattern) match(r *http.Request, c *C, dryrun bool) bool { } path = path[len(sli):] - m := strings.IndexRune(path, '/') - if m == -1 { - m = len(path) + m := 0 + for ; m < len(path); m++ { + if path[m] == '/' { + break + } } if m == 0 { // Empty strings are not matches, otherwise routes like