tidwall / evio

Fast event-loop networking for Go
MIT License
5.9k stars 493 forks source link

Fix http server example - parsing request path and query #62

Open ewgRa opened 4 years ago

ewgRa commented 4 years ago

When I run "go run main.go --noparse=false" and made request like "curl localhost:8080/aaa?dddd=ddd" I got panic:

panic: runtime error: slice bounds out of range [:17] with length 0 goroutine 6 [running]: main.parsereq(0xc00001e240, 0x5a, 0x60, 0xc000059a78, 0x900100004367cc, 0x0, 0x8, 0x417e5e, 0xc000059a38) /home/ewgra/dev/go/src/github.com/tidwall/evio/examples/http-server/main.go:175 +0x773

This PR fixes http server example - parsing request path and query.