From 8f13080267d0ddbb50da9029339796841224116a Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Wed, 18 May 2016 15:42:54 +0000 Subject: net/http: allow Client.CheckRedirect to use most recent response Fixes #10069 Change-Id: I3819ff597d5a0c8e785403bf9d65a054f50655a6 Reviewed-on: https://go-review.googlesource.com/23207 Reviewed-by: Russ Cox --- src/net/http/request.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/net/http/request.go') diff --git a/src/net/http/request.go b/src/net/http/request.go index 45507d23d1..e8780dea94 100644 --- a/src/net/http/request.go +++ b/src/net/http/request.go @@ -255,6 +255,11 @@ type Request struct { // set, it is undefined whether Cancel is respected. Cancel <-chan struct{} + // Response is the redirect response which caused this request + // to be created. This field is only populated during client + // redirects. + Response *Response + // ctx is either the client or server context. It should only // be modified via copying the whole Request using WithContext. // It is unexported to prevent people from using Context wrong -- cgit v1.3-6-g1900