diff options
Diffstat (limited to '')
-rw-r--r-- | router_test.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/router_test.go b/router_test.go index cb18fba..71fdcaf 100644 --- a/router_test.go +++ b/router_test.go @@ -2,6 +2,8 @@ package router import ( "github.com/franckcuny/web-request" + "net/http" + "net/url" "testing" ) @@ -142,3 +144,14 @@ func TestAddNotAllowed(t *testing.T) { t.Fatal() } } + +func TestMessyPath(t *testing.T) { + r := BuildRouter() + r.AddRoute(&Route{Method: "GET", Path: "/baz", Code: testRoute}) + req := &http.Request{Method: "GET", URL: &url.URL{Path: "///////baz"}} + m, _ := r.Match(req) + + if m == nil { + t.Fatal() + } +} |