]> Cypherpunks repositories - gostls13.git/commit
net/http, net/http/httptest: make http2's TrailerPrefix work for http1
authorBrad Fitzpatrick <bradfitz@golang.org>
Tue, 1 Nov 2016 15:24:11 +0000 (15:24 +0000)
committerBrad Fitzpatrick <bradfitz@golang.org>
Tue, 1 Nov 2016 17:01:30 +0000 (17:01 +0000)
commitb2c54afe1451f93e1fbbad257a151d8425cd308d
tree8a5df30c71c5c51b644311b5bc79a144b0f752d5
parent3c2f607274b2284826ea887fa9d2ef62817df608
net/http, net/http/httptest: make http2's TrailerPrefix work for http1

Go's http1 implementation originally had a mechanism to send HTTP
trailers based on pre-declaring the trailer keys whose values you'd
later let after the header was written.

http2 copied the same mechanism, but it was found to be unsufficient
for gRPC's wire protocol. A second trailer mechanism was added later
(but only to http2) for handlers that want to send a trailer without
knowing in advance they'd need to.

Copy the same mechanism back to http1 and document it.

Fixes #15754

Change-Id: I8c40d55e28b0e5b7087d3d1a904a392c56ee1f9b
Reviewed-on: https://go-review.googlesource.com/32479
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/net/http/clientserver_test.go
src/net/http/httptest/recorder.go
src/net/http/httptest/recorder_test.go
src/net/http/server.go