]> Cypherpunks repositories - gostls13.git/commit
net/http: don't allow Content-Type or body on 204 and 1xx
authorBrad Fitzpatrick <bradfitz@golang.org>
Thu, 16 Jan 2014 19:43:52 +0000 (11:43 -0800)
committerBrad Fitzpatrick <bradfitz@golang.org>
Thu, 16 Jan 2014 19:43:52 +0000 (11:43 -0800)
commit36477291cc13313e816cccfcfa62a6bc0ac43d15
tree15491544e5fd6a10664ee7d62cad1f68bbb5bbbb
parent18d644111ea18b2c778d67f0507f9b2a21a47dfd
net/http: don't allow Content-Type or body on 204 and 1xx

Status codes 204, 304, and 1xx don't allow bodies. We already
had a function for this, but we were hard-coding just 304
(StatusNotModified) in a few places.  Use the function
instead, and flesh out tests for all codes.

Fixes #6685

R=golang-codereviews, r
CC=golang-codereviews
https://golang.org/cl/53290044
src/pkg/net/http/serve_test.go
src/pkg/net/http/server.go