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
Run this hello world snippet
package main import ( "fmt" "log" "github.com/buaazp/fasthttprouter" "github.com/valyala/fasthttp" ) func Hello(ctx *fasthttp.RequestCtx) { fmt.Fprintf(ctx, "hello, %s!\n", ctx.UserValue("name")) } func main() { router := fasthttprouter.New() router.GET("/hello/:name", Hello) log.Fatal(fasthttp.ListenAndServe(":8080", router.Handler)) }
Send a HEAD request
$ curl -I http://localhost:8080/hello/test 47ms curl: (52) Empty reply from server
Results in:
panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x482962] goroutine 34 [running]: panic(0x634b40, 0xc42000c100) /usr/local/go/src/runtime/panic.go:500 +0x1a1 github.com/valyala/fasthttp.(*RequestCtx).SetUserValue(0x0, 0x67ee99, 0x4, 0x621d40, 0xc4201280d0) /home/kailash/code/go/src/github.com/valyala/fasthttp/server.go:461 +0x22 github.com/buaazp/fasthttprouter.(*node).getValue(0xc420018780, 0xc4201280c7, 0x4, 0x0, 0xc4201182f8, 0xfe5) /home/kailash/code/go/src/github.com/buaazp/fasthttprouter/tree.go:364 +0x1c7 github.com/buaazp/fasthttprouter.(*Router).allowed(0xc420013200, 0xc4201280c0, 0xb, 0xc42003ac98, 0x4, 0x4, 0x59) /home/kailash/code/go/src/github.com/buaazp/fasthttprouter/router.go:273 +0x13d github.com/buaazp/fasthttprouter.(*Router).Handler(0xc420013200, 0xc420138000) /home/kailash/code/go/src/github.com/buaazp/fasthttprouter/router.go:353 +0x23e github.com/buaazp/fasthttprouter.(*Router).Handler-fm(0xc420138000) /home/kailash/Desktop/fast.go:19 +0x34 github.com/valyala/fasthttp.(*Server).serveConn(0xc4200983c0, 0x794040, 0xc420132000, 0x1, 0x101) /home/kailash/code/go/src/github.com/valyala/fasthttp/server.go:1536 +0x573 github.com/valyala/fasthttp.(*Server).(github.com/valyala/fasthttp.serveConn)-fm(0x794040, 0xc420132000, 0xc420120758, 0x1) /home/kailash/code/go/src/github.com/valyala/fasthttp/server.go:1250 +0x3e github.com/valyala/fasthttp.(*workerPool).workerFunc(0xc420092480, 0xc42012a100) /home/kailash/code/go/src/github.com/valyala/fasthttp/workerpool.go:210 +0xde github.com/valyala/fasthttp.(*workerPool).getCh.func1(0xc420092480, 0xc42012a100, 0x616480, 0xc42012a100) /home/kailash/code/go/src/github.com/valyala/fasthttp/workerpool.go:182 +0x35 created by github.com/valyala/fasthttp.(*workerPool).getCh /home/kailash/code/go/src/github.com/valyala/fasthttp/workerpool.go:184 +0x111 exit status 2
The text was updated successfully, but these errors were encountered:
Dup bug with #15
Fixed if you pull the latest code in master.
curl -I http://localhost:8080/hello/test HTTP/1.1 405 Method Not Allowed Server: fasthttp Date: Mon, 19 Dec 2016 14:28:53 GMT Content-Type: text/plain; charset=utf-8 Content-Length: 18 Allow: GET, OPTIONS
Sorry, something went wrong.
Yep, it's resolved.
No branches or pull requests
Run this hello world snippet
Send a HEAD request
Results in:
The text was updated successfully, but these errors were encountered: