aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Wiacek <mjwiacek@google.com>2016-12-28 16:15:35 -0800
committerBrad Fitzpatrick <bradfitz@golang.org>2016-12-29 22:29:47 +0000
commit9e199702c829d303ebe001a09c47aa4ec3b3ff81 (patch)
treeb2443e5b26ac6fac3d54ac3b00aaecfec4476835
parent9719ca9c0e6fdda273cd178e6cce6b88d738518e (diff)
downloadgo-9e199702c829d303ebe001a09c47aa4ec3b3ff81.tar.gz
go-9e199702c829d303ebe001a09c47aa4ec3b3ff81.zip
net/http/httputil: clarify the contract on ReverseProxy's Director.
Avoid potential race conditions by clarifying to implemntors of the ReverseProxy interface, the lifetime of provided http.Request structs. Fixes #18456 Change-Id: I46aa60322226ecc3a0d30fa1ef108e504171957a Reviewed-on: https://go-review.googlesource.com/34720 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-rw-r--r--src/net/http/httputil/reverseproxy.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/net/http/httputil/reverseproxy.go b/src/net/http/httputil/reverseproxy.go
index 7867505708..79c8fe2770 100644
--- a/src/net/http/httputil/reverseproxy.go
+++ b/src/net/http/httputil/reverseproxy.go
@@ -30,6 +30,8 @@ type ReverseProxy struct {
// the request into a new request to be sent
// using Transport. Its response is then copied
// back to the original client unmodified.
+ // Director must not access the provided Request
+ // after returning.
Director func(*http.Request)
// The transport used to perform proxy requests.