]> Cypherpunks repositories - gostls13.git/commit
net/http/httputil: make ReverseProxy support Trailers
authorBrad Fitzpatrick <bradfitz@golang.org>
Mon, 6 Jul 2015 22:57:35 +0000 (15:57 -0700)
committerBrad Fitzpatrick <bradfitz@golang.org>
Tue, 7 Jul 2015 14:30:49 +0000 (14:30 +0000)
commit72970f7f52b1f8d14f10df40098175763a556ebe
treea322601a27c1c8670334e9285b747a487ca4b69b
parentef37184c07d501f76edfa36b8bf1101d5dc8b44d
net/http/httputil: make ReverseProxy support Trailers

Go's continuous build system depends on HTTP trailers for the buildlet
interface.

Andrew rewrote the makerelease tool to work in terms of Go's builder
system (now at x/build/cmd/release), but it previously could only
create GCE-based buildlets, which meant x/build/cmd/release couldn't
build the release for Darwin.

https://golang.org/cl/11901 added support for proxying buildlet
connections via the coordinator, but that exposed the fact that
httputil.ReverseProxy couldn't proxy Trailers. A fork of that code
also wasn't possible because net/http needlessly deleted the "Trailer"
response header in the Transport code.  This mistake goes back to
"release-branch.r56" and earlier but was never noticed because nobody
ever uses Trailers, and servers via ResponseWriter never had the
ability to even set trailers before this Go 1.5. Note that setting
trailers requires pre-declaring (in the response header) which
trailers you'll set later (after the response body). Because you could
never set them, before this release you could also never proxy them.

Change-Id: I2410a099921790dcd391675ae8610300efa19108
Reviewed-on: https://go-review.googlesource.com/11940
Reviewed-by: Andrew Gerrand <adg@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
src/net/http/httputil/reverseproxy.go
src/net/http/httputil/reverseproxy_test.go