From 9e199702c829d303ebe001a09c47aa4ec3b3ff81 Mon Sep 17 00:00:00 2001 From: Mike Wiacek Date: Wed, 28 Dec 2016 16:15:35 -0800 Subject: [PATCH] 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 --- src/net/http/httputil/reverseproxy.go | 2 ++ 1 file changed, 2 insertions(+) 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. -- 2.48.1