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
Hoverfly panics when sending null to /api/v2/state.
null
/api/v2/state
Start hoverfly, then
curl --request PUT \ --url http://localhost:8601/api/v2/state \ --header 'content-type: application/json' \ --data 'null'
Hoverfly error messages seen (If none, say none)
PANIC: runtime error: invalid memory address or nil pointer dereference goroutine 7 [running]: github.com/codegangsta/negroni.(*Recovery).ServeHTTP.func1() /home/circleci/hoverfly/vendor/github.com/codegangsta/negroni/recovery.go:159 +0xad panic({0xce9080?, 0x159f390?}) /usr/local/go/src/runtime/panic.go:770 +0x132 github.com/SpectoLabs/hoverfly/core/handlers/v2.(*StateHandler).Put(0xc000114be0, {0x7f19b860eaf8, 0xc00011c030}, 0xc0003cc6c0, 0x0?) /home/circleci/hoverfly/core/handlers/v2/state_handler.go:73 +0xf3 github.com/codegangsta/negroni.HandlerFunc.ServeHTTP(0x10?, {0x7f19b860eaf8?, 0xc00011c030?}, 0x467da5?, 0x10?) /home/circleci/hoverfly/vendor/github.com/codegangsta/negroni/negroni.go:29 +0x2d github.com/codegangsta/negroni.middleware.ServeHTTP({{0xfa9560?, 0xc000115210?}, 0xc0000113c8?}, {0x7f19b860eaf8, 0xc00011c030}, 0xc0003cc6c0) /home/circleci/hoverfly/vendor/github.com/codegangsta/negroni/negroni.go:38 +0xa8 github.com/SpectoLabs/hoverfly/core/handlers.(*AuthHandler).RequireTokenAuthentication(0x20?, {0x7f19b860eaf8?, 0xc00011c030?}, 0x0?, 0x0?) /home/circleci/hoverfly/core/handlers/auth_handler.go:50 +0x153 github.com/codegangsta/negroni.HandlerFunc.ServeHTTP(0xc00047b800?, {0x7f19b860eaf8?, 0xc00011c030?}, 0xd75660?, 0x412101?) /home/circleci/hoverfly/vendor/github.com/codegangsta/negroni/negroni.go:29 +0x2d github.com/codegangsta/negroni.middleware.ServeHTTP({{0xfa9560?, 0xc000115200?}, 0xc0000113b0?}, {0x7f19b860eaf8, 0xc00011c030}, 0xc0003cc6c0) /home/circleci/hoverfly/vendor/github.com/codegangsta/negroni/negroni.go:38 +0xa8 github.com/codegangsta/negroni.(*Negroni).ServeHTTP(0xc0002e30e0, {0x7f19b860eaf8, 0xc00011c028}, 0xc0003cc6c0) /home/circleci/hoverfly/vendor/github.com/codegangsta/negroni/negroni.go:96 +0x105 github.com/go-zoo/bone.(*Route).parse(0xc0000c8c60, {0x7f19b860eaf8, 0xc00011c028}, 0xc0003cc6c0) /home/circleci/hoverfly/vendor/github.com/go-zoo/bone/route.go:171 +0x1ba github.com/go-zoo/bone.(*Mux).parse(0xc0002c2000, {0x7f19b860eaf8, 0xc00011c028}, 0xc0003cc6c0) /home/circleci/hoverfly/vendor/github.com/go-zoo/bone/helper.go:23 +0x91 github.com/go-zoo/bone.(*Mux).DefaultServe(0xc0002c2000, {0x7f19b860eaf8, 0xc00011c028}, 0xc0003cc6c0) /home/circleci/hoverfly/vendor/github.com/go-zoo/bone/bone.go:71 +0x2b github.com/go-zoo/bone.(*Mux).ServeHTTP(0xc000580008?, {0x7f19b860eaf8?, 0xc00011c028?}, 0x0?) /home/circleci/hoverfly/vendor/github.com/go-zoo/bone/bone.go:90 +0x98 github.com/codegangsta/negroni.(*Negroni).UseHandler.Wrap.func1({0x7f19b860eaf8, 0xc00011c028}, 0xc0003cc6c0, 0xc000091380) /home/circleci/hoverfly/vendor/github.com/codegangsta/negroni/negroni.go:46 +0x45 github.com/codegangsta/negroni.HandlerFunc.ServeHTTP(0x40ec27?, {0x7f19b860eaf8?, 0xc00011c028?}, 0x8?, 0x3?) /home/circleci/hoverfly/vendor/github.com/codegangsta/negroni/negroni.go:29 +0x2d github.com/codegangsta/negroni.middleware.ServeHTTP({{0xfa9560?, 0xc000010318?}, 0xc000010720?}, {0x7f19b860eaf8, 0xc00011c028}, 0xc0003cc6c0) /home/circleci/hoverfly/vendor/github.com/codegangsta/negroni/negroni.go:38 +0xa8 github.com/codegangsta/negroni.(*Recovery).ServeHTTP(0xc00047bb00?, {0x7f19b860eaf8?, 0xc00011c028?}, 0xd75660?, 0x412101?) /home/circleci/hoverfly/vendor/github.com/codegangsta/negroni/recovery.go:193 +0x7b github.com/codegangsta/negroni.middleware.ServeHTTP({{0xfa9460?, 0xc0000a2e10?}, 0xc000010330?}, {0x7f19b860eaf8, 0xc00011c028}, 0xc0003cc6c0) /home/circleci/hoverfly/vendor/github.com/codegangsta/negroni/negroni.go:38 +0xa8 github.com/codegangsta/negroni.(*Negroni).ServeHTTP(0xc0002e3710, {0xfae720, 0xc000194380}, 0xc0003cc6c0) /home/circleci/hoverfly/vendor/github.com/codegangsta/negroni/negroni.go:96 +0x105 net/http.serverHandler.ServeHTTP({0xfac678?}, {0xfae720?, 0xc000194380?}, 0x6?) /usr/local/go/src/net/http/server.go:3142 +0x8e net/http.(*conn).serve(0xc000314480, {0xfafe10, 0xc000333a10}) /usr/local/go/src/net/http/server.go:2044 +0x5e8 created by net/http.(*Server).Serve in goroutine 1 /usr/local/go/src/net/http/server.go:3290 +0x4b4
State should set to the "default" state, i.e. all state cleared.
The text was updated successfully, but these errors were encountered:
#1165 add validation to the put state endpoint
5579abb
Thanks for the report @mjhcorporate I've raised a PR to fix it.
Sorry, something went wrong.
b45de44
#1165 add validation to the put state endpoint (#1166)
3924ef2
No branches or pull requests
Description of the bug
Hoverfly panics when sending
null
to/api/v2/state
.Steps to reproduce the issue
Start hoverfly, then
Observed result
Hoverfly error messages seen (If none, say none)
Expected result
State should set to the "default" state, i.e. all state cleared.
Additional relevant information
The text was updated successfully, but these errors were encountered: