diff --git a/router.go b/router.go index 2d7964f..2d2f262 100644 --- a/router.go +++ b/router.go @@ -110,11 +110,7 @@ func (r *router) Handle(res http.ResponseWriter, req *http.Request, context Cont params := Params(vals) context.Map(params) route.Handle(context, res) - if context.Written() { - return - } else { - break - } + return } } diff --git a/router_test.go b/router_test.go index 7329fcd..9c18a65 100644 --- a/router_test.go +++ b/router_test.go @@ -125,6 +125,8 @@ func Test_Routing(t *testing.T) { router.Handle(recorder, req12, context12) router.Handle(recorder, req13, context13) expect(t, result, "foobarbatbarfoofezpopbapwappowwappowoptsfoobazzingagetbazzingapostbazzingagroupception") + expect(t, recorder.Code, http.StatusNotFound) + expect(t, recorder.Body.String(), "404 page not found\n") } func Test_RouterHandlerStatusCode(t *testing.T) {