Skip to content

Commit

Permalink
Merge pull request #249 from go-martini/JMS-Revert-246
Browse files Browse the repository at this point in the history
Reverting changes from #246
  • Loading branch information
codegangsta committed Apr 25, 2014
2 parents c7203d5 + 5f090c9 commit de64386
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 1 addition & 5 deletions router.go
Expand Up @@ -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
}
}

Expand Down
2 changes: 2 additions & 0 deletions router_test.go
Expand Up @@ -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) {
Expand Down

1 comment on commit de64386

@sevkin
Copy link
Contributor

@sevkin sevkin commented on de64386 Apr 25, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@codegangsta may be add NoContent handler similar to NotFound but fired if context.Written() == false ?
now i not see single point for handle all routes with wrong params

Please sign in to comment.