]> Cypherpunks repositories - gostls13.git/commit
net/http/httputil: add ModifyResponse to reverseProxy
authorEmmanuel Odeke <emm.odeke@gmail.com>
Fri, 28 Oct 2016 15:11:39 +0000 (08:11 -0700)
committerBrad Fitzpatrick <bradfitz@golang.org>
Tue, 1 Nov 2016 13:05:58 +0000 (13:05 +0000)
commit4a13f31ffd4ff8648ccc4c2b2193abde22f7fd26
tree7c1fe1715dff3a8584bc03e0bd611d0fc1c9a1c0
parent032d150bd4a812eee9c3ea017f0d3acc8c484325
net/http/httputil: add ModifyResponse to reverseProxy

Adds ModifyResponse, an optional func to ReverseProxy
that modifies a response in the backend, right before
the headers of the response are written to the internal
response writer.
If ModifyResponse returns an error, the proxy returns
a StatusBadGateway error.

Fixes #14237.

Change-Id: I8e03139e34dea0084512ccbd8cc49e941bf9fb5d
Reviewed-on: https://go-review.googlesource.com/32356
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/net/http/httputil/reverseproxy.go
src/net/http/httputil/reverseproxy_test.go