Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
net/http: fix panic error message on Request.Body read after Hijack #20933
What version of Go are you using (
Yes, this was changed in Go 1.8.
After your call to Hijack, you're not supposed to read from Request.Body anymore. I'll keep this bug open to fix that error message.
After a hijack, you're expected to read from the returned bufio.Reader:
(That includes the 1 byte)
BTW, the time for Go 1.8 feedback was in December. We're currently wrapping up Go 1.9, which is almost out. If you could test Go 1.9beta2, that'd b egreat.
Is that explicitly documented anywhere?
I can confirm that rearranging the example so that it Hijacks only after fully reading the request seems to fix it: https://play.golang.org/p/akmrJbBnN6