New issue
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
net/http: http2 negative content length #14003
Labels
Milestone
Comments
rafaeljusto
changed the title
http2 negative content length
net/http: http2 negative content length
Jan 18, 2016
Confirmed. func TestH12_RequestContentLength(t *testing.T) {
h12Compare{
Handler: func(w ResponseWriter, r *Request) {
w.Header().Set("Got-Length", fmt.Sprint(r.ContentLength))
fmt.Fprintf(w, "Req.ContentLength=%v", r.ContentLength)
},
ReqFunc: func(c *Client, url string) (*Response, error) {
return c.Post(url, "text/plain", strings.NewReader("FOUR"))
},
CheckResponse: func(proto string, res *Response) {
if got := res.Header.Get("Got-Length"); got != "4" {
t.Errorf("Proto %q got length %q; want %q", proto, got, "4")
}
},
}.run(t)
}
|
CL https://golang.org/cl/18730 mentions this issue. |
CL https://golang.org/cl/18709 mentions this issue. |
gopherbot
pushed a commit
to golang/net
that referenced
this issue
Jan 18, 2016
Same policy and logic (and comments) as the net/http.Transport. Updates golang/go#14003 Change-Id: I5744140fed16c00b0dc9a4bc74631b7df7d8241c Reviewed-on: https://go-review.googlesource.com/18709 Reviewed-by: Andrew Gerrand <adg@golang.org>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi,
I was testing Go1.6-beta2 and found a strange behavior with HTTP2. I developed a simple server that only prints the request content-length. When tested with Go1.5 it works fine (content-length greater or equal to zero), but when I submit some content in Go1.6 using HTTP2 (TLS) the server prints -1.
Server:
Client:
The text was updated successfully, but these errors were encountered: