From: Mike Wiacek Date: Thu, 29 Dec 2016 00:15:35 +0000 (-0800) Subject: net/http/httputil: clarify the contract on ReverseProxy's Director. X-Git-Tag: go1.8rc1~48 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=9e199702c829d303ebe001a09c47aa4ec3b3ff81;p=gostls13.git 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 --- 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.