]> Cypherpunks repositories - gostls13.git/commitdiff
net/http/httputil: clarify the contract on ReverseProxy's Director.
authorMike Wiacek <mjwiacek@google.com>
Thu, 29 Dec 2016 00:15:35 +0000 (16:15 -0800)
committerBrad Fitzpatrick <bradfitz@golang.org>
Thu, 29 Dec 2016 22:29:47 +0000 (22:29 +0000)
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>
src/net/http/httputil/reverseproxy.go

index 78675057085c23bce6c5282af50ff67bf7aaf520..79c8fe27702fbbece3b81451c9aa23db5891ecfc 100644 (file)
@@ -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.