Skip to content

Commit

Permalink
Fixed labstack#151 - panic for invalid HTTP method
Browse files Browse the repository at this point in the history
Signed-off-by: Vishal Rana <[email protected]>
  • Loading branch information
vishr committed Jul 21, 2015
1 parent 17c83a0 commit fd427bc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion router.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,11 @@ func (r *Router) treeIndex(method string) uint8 {
}

func (r *Router) Find(method, path string, ctx *Context) (h HandlerFunc, e *Echo) {
cn := r.trees[r.treeIndex(method)] // Current node as root
i := r.treeIndex(method)
if i > 20 {
return
}
cn := r.trees[i] // Current node as root
search := path

var (
Expand Down

0 comments on commit fd427bc

Please sign in to comment.