Skip to content

Commit ad4ce0e

Browse files
ShaneSawwkisielk
authored andcommitted
updating logic in route matcher, cleaner and saner (#235)
1 parent 999ef73 commit ad4ce0e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

route.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ func (r *Route) addRegexpMatcher(tpl string, matchHost, matchPrefix, matchQuery
153153
}
154154
r.regexp = r.getRegexpGroup()
155155
if !matchHost && !matchQuery {
156-
if tpl == "/" && (len(tpl) == 0 || tpl[0] != '/') {
156+
if len(tpl) > 0 && tpl[0] != '/' {
157157
return fmt.Errorf("mux: path must start with a slash, got %q", tpl)
158158
}
159159
if r.regexp.path != nil {

0 commit comments

Comments
 (0)