The retryablehttp.Client.RequestLogHook must be set to get rid of RequestURI, otherwise the client hits the error http: Request.RequestURI can't be set in client requests.
retryClient.RequestLogHook = func(l retryablehttp.Logger, r *http.Request, n int) {
r.RequestURI = ""
}
the retryablehttp.Client.HTTPClient.CheckRedirect must be set to not follow redirects, otherwise they are not passed straight to the other end of the wire and stuff, like cookies, might end up lost.
Hey,
for retry purposes I mixed that client with
httputil.NewSingleHostReverseProxy
, like inI had to deal with two difficulties.
The
retryablehttp.Client.RequestLogHook
must be set to get rid ofRequestURI
, otherwise the client hits the errorhttp: Request.RequestURI can't be set in client requests
.the
retryablehttp.Client.HTTPClient.CheckRedirect
must be set to not follow redirects, otherwise they are not passed straight to the other end of the wire and stuff, like cookies, might end up lost.Tha's all, maybe someone else did that before and can provide some more hints.
Anyways, thanks !