]> Cypherpunks repositories - gostls13.git/commit
net/http: omit Content-Length in Response.Write for 1xx or 204 status
authorMatt Layher <mdlayher@gmail.com>
Thu, 1 Sep 2016 20:30:15 +0000 (16:30 -0400)
committerBrad Fitzpatrick <bradfitz@golang.org>
Thu, 1 Sep 2016 21:10:22 +0000 (21:10 +0000)
commit88ccb3c945daeba7c08dfe9b39be18ec78941a45
treef3ed5e6f61ec019443d9646652a3db9037310745
parent8895a99c9ff522cf41f3a1bee365bd0c7e0c7900
net/http: omit Content-Length in Response.Write for 1xx or 204 status

Per RFC 7230, Section 3.3.2: "A server MUST NOT send a Content-Length
header field in any response with a status code of 1xx (Informational)
or 204 (No Content).".

Fixes #16942

Change-Id: I8006c76c126304e13618966e6eafb08a3885d3cd
Reviewed-on: https://go-review.googlesource.com/28351
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/net/http/response.go
src/net/http/responsewrite_test.go