Commit 9e199702 authored by Mike Wiacek's avatar Mike Wiacek Committed by Brad Fitzpatrick

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/34720Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
parent 9719ca9c
...@@ -30,6 +30,8 @@ type ReverseProxy struct { ...@@ -30,6 +30,8 @@ type ReverseProxy struct {
// the request into a new request to be sent // the request into a new request to be sent
// using Transport. Its response is then copied // using Transport. Its response is then copied
// back to the original client unmodified. // back to the original client unmodified.
// Director must not access the provided Request
// after returning.
Director func(*http.Request) Director func(*http.Request)
// The transport used to perform proxy requests. // The transport used to perform proxy requests.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment