Closed dkarlovi closed 1 year ago
@dunglas would appreciate your feedback too.
https://github.com/darkweak/go-esi/pull/9/files#diff-49119e92a6bdccc63d27f7f553246cf3297eb16dc4a8cc08fa2ab344351facacR91 Apply these changes below:
if (err != nil || response.StatusCode >= 400) && i.alt != "" {
rq, _ = http.NewRequest(http.MethodGet, sanitizeURL(i.alt, req.URL), nil)
addHeaders(headersSafe, req, rq)
if rq.URL.Scheme == req.URL.Scheme && rq.URL.Host == req.URL.Host {
addHeaders(headersUnsafe, req, rq)
}
response, err = client.Do(rq)
if err != nil || response.StatusCode >= 400 {
return nil, len(b)
}
}
if response == nil {
return nil, i.length
}
Closing here so not to cause conflicts in #10, see https://github.com/darkweak/go-esi/pull/10#issuecomment-1324777361
Closes #5.