From ad4ce0eb1694e1a48fd8e2e764dd0e1aec118326 Mon Sep 17 00:00:00 2001 From: Shane Smith-Sahnow Date: Mon, 27 Feb 2017 19:44:49 -0800 Subject: [PATCH] updating logic in route matcher, cleaner and saner (#235) --- route.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/route.go b/route.go index 9221915..5544c1f 100644 --- a/route.go +++ b/route.go @@ -153,7 +153,7 @@ func (r *Route) addRegexpMatcher(tpl string, matchHost, matchPrefix, matchQuery } r.regexp = r.getRegexpGroup() if !matchHost && !matchQuery { - if tpl == "/" && (len(tpl) == 0 || tpl[0] != '/') { + if len(tpl) > 0 && tpl[0] != '/' { return fmt.Errorf("mux: path must start with a slash, got %q", tpl) } if r.regexp.path != nil {