We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The following program panics with "slice bounds out of range" error. This case should be caught and a more understandable message issued instead.
package main import ( "github.com/julienschmidt/httprouter" "net/http" ) func main() { r := httprouter.New() r.Handle("GET", "/:foo:bar/oops", func(http.ResponseWriter, *http.Request, httprouter.Params) {}) }
The panic is as follows:
panic: runtime error: slice bounds out of range goroutine 1 [running]: github.com/julienschmidt/httprouter.(*node).insertChild(0xc20805c120, 0x1, 0x6bd190, 0xe, 0x72ea70) /home/rog/src/go/src/github.com/julienschmidt/httprouter/tree.go:217 +0x57a github.com/julienschmidt/httprouter.(*node).addRoute(0xc20805c060, 0x6bd190, 0xe, 0x72ea70) /home/rog/src/go/src/github.com/julienschmidt/httprouter/tree.go:184 +0xac github.com/julienschmidt/httprouter.(*Router).Handle(0xc208030f70, 0x6af1d0, 0x3, 0x6bd190, 0xe, 0x72ea70) /home/rog/src/go/src/github.com/julienschmidt/httprouter/router.go:219 +0x1ae main.main() /home/rog/src/tst.go:10 +0x9a
The text was updated successfully, but these errors were encountered:
Even worse: /:foo:bar currently works without panicking at all and the router creates nodes for both :foo:bar and :bar! I'm working on a fix.
/:foo:bar
:foo:bar
:bar
Sorry, something went wrong.
a647d3a
Check for multiple wildcards per path segment
c3165de
Fixes #56
julienschmidt
No branches or pull requests
The following program panics with "slice bounds out of range" error. This
case should be caught and a more understandable message issued instead.
The panic is as follows:
The text was updated successfully, but these errors were encountered: