Skip to content

Commit

Permalink
Refactored some code
Browse files Browse the repository at this point in the history
Signed-off-by: Vishal Rana <[email protected]>
  • Loading branch information
vishr committed Mar 30, 2016
1 parent 55e3dba commit a7d1a8e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions router.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ func (n *node) findHandler(method string) Handler {
}
}

func (n *node) check405() HandlerFunc {
func (n *node) checkMethodNotAllowed() HandlerFunc {
for _, m := range methods {
if h := n.findHandler(m); h != nil {
return methodNotAllowedHandler
Expand Down Expand Up @@ -412,7 +412,7 @@ End:

// NOTE: Slow zone...
if ctx.handler == nil {
ctx.handler = cn.check405()
ctx.handler = cn.checkMethodNotAllowed()

// Dig further for any, might have an empty value for *, e.g.
// serving a directory. Issue #207.
Expand All @@ -421,7 +421,7 @@ End:
}
ctx.pvalues[len(cn.pnames)-1] = ""
if ctx.handler = cn.findHandler(method); ctx.handler == nil {
ctx.handler = cn.check405()
ctx.handler = cn.checkMethodNotAllowed()
}
}
return
Expand Down

0 comments on commit a7d1a8e

Please sign in to comment.