]> Cypherpunks repositories - gostls13.git/commit
net/http: validate transmitted header fields
authorBrad Fitzpatrick <bradfitz@golang.org>
Thu, 31 Mar 2016 03:33:46 +0000 (14:33 +1100)
committerBrad Fitzpatrick <bradfitz@golang.org>
Thu, 31 Mar 2016 04:55:58 +0000 (04:55 +0000)
commit0026cb788b54e3108534992d98b7fec0cf96de17
tree8a7665cd739b9f00e12bd3dc6747cba890ff02e3
parentb4117995e3e01a669be737c36033c2393858d555
net/http: validate transmitted header fields

This makes sure the net/http package never attempts to transmit a
bogus header field key or value and instead fails fast with an error
to the user, rather than relying on the server to maybe return an
error.

It's still possible to use x/net/http2.Transport directly to send
bogus stuff. This change only stops h1 & h2 usage via the net/http
package. A future change will update x/net/http2.

This change also moves some code from request.go to lex.go, which in a
separate future change should be moved so it can be shared with http2
to reduce code bloat.

Updates #14048

Change-Id: I0a44ae1ab357fbfcbe037aa4b5d50669a87f2856
Reviewed-on: https://go-review.googlesource.com/21326
Reviewed-by: Andrew Gerrand <adg@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/net/http/clientserver_test.go
src/net/http/lex.go
src/net/http/request.go
src/net/http/transport.go