// RoundTrip implements http.RoundTripper
RoundTrip implements http.RoundTripper
// RoundTrip implements http . RoundTripper
func (t *RedirectFollower) RoundTrip(req *http.Request) (*http.Response, error) {
	resp, err := t.RoundTripper.RoundTrip(req)
	if err != nil {
		return resp, err
	}
	if resp.StatusCode >= 300 && resp.StatusCode < 400 {
		l, err := resp.Location()
		if err != nil {
			return resp, err
		}
		cReq := req.Clone(req.Context())
		resp.Request = cReq
		cReq.Header = http.Header{}
		cReq.URL = l
		cReq.Host = l.Host
		cReq.RequestURI = l.RequestURI()
		cReq.Header.Set("X-Forwarded-Host", l.Host)
		resp.Request = cReq
		return resp, err
	}
	return resp, err
}
func ( t * RedirectFollower ) RoundTrip ( req * http . Request ) ( * http . Response , error ) { resp , err := t . RoundTripper . RoundTrip ( req ) if err != nil { return resp , err } if resp . StatusCode >= 300 && resp . StatusCode < 400 { l , err := resp . Location ( ) if err != nil { return resp , err } cReq := req . Clone ( req . Context ( ) ) resp . Request = cReq cReq . Header = http . Header { } cReq . URL = l cReq . Host = l . Host cReq . RequestURI = l . RequestURI ( ) cReq . Header . Set ( " " , l . Host ) resp . Request = cReq return resp , err } return resp , err }
RoundTrip implements http.RoundTripper
RoundTrip implements http . RoundTripper
// follow redirects // cContext := context.WithValue(req.Context(), CtxPath, req.URL.Path)