Handle preferred hosts in redirects too

This commit is contained in:
Ben Sarmiento
2023-11-24 22:03:31 +01:00
parent 595040ad7e
commit cbd291400f
2 changed files with 23 additions and 6 deletions

View File

@@ -23,8 +23,8 @@ type HTTPClient struct {
func (r *HTTPClient) Do(req *http.Request) (*http.Response, error) {
if r.config != nil && strings.Contains(req.Host, "download.real-debrid.") {
prefHost := r.config.GetRandomPreferredHost()
if host := prefHost; host != "" {
req.Host = r.config.GetRandomPreferredHost()
if prefHost != "" {
req.Host = prefHost
}
}
if r.BearerToken != "" {