]> Cypherpunks repositories - gostls13.git/commit
net/http: don't send chunked encoding on 204 responses
authorBrad Fitzpatrick <bradfitz@golang.org>
Fri, 30 Nov 2012 02:00:51 +0000 (18:00 -0800)
committerBrad Fitzpatrick <bradfitz@golang.org>
Fri, 30 Nov 2012 02:00:51 +0000 (18:00 -0800)
commit9c2f410206221473a9773849ab9749c6602ce11a
tree9ab62e7adb8808255b5c9858a25fd358b21b153e
parent85e451e2fe3aae0c5d066cd0ee5f178877139188
net/http: don't send chunked encoding on 204 responses

RFC 2616: "The 204 response MUST NOT include a message-body,
and thus is always terminated by the first empty line after
the header fields."

Previously we'd trigger chunked encoding by default on
responses, and then when finishing the request we'd write the
chunk trailers, which counted as a message-body.

Fixes #4454

R=golang-dev
CC=golang-dev
https://golang.org/cl/6782139
src/pkg/net/http/server.go
src/pkg/net/http/transport_test.go