Fix location of pref hosts injection

This commit is contained in:
Ben Sarmiento
2024-01-07 16:17:31 +01:00
parent 120df54f35
commit 769c4a6803
3 changed files with 22 additions and 21 deletions

View File

@@ -105,13 +105,6 @@ func NewHTTPClient(token string, maxRetries int, timeoutSecs int, cfg config.Con
}
func (r *HTTPClient) Do(req *http.Request) (*http.Response, error) {
if r.cfg != nil && strings.Contains(req.Host, "download.real-debrid.") {
prefHost := r.cfg.GetRandomPreferredHost()
if prefHost != "" {
req.Host = prefHost
req.URL.Host = prefHost
}
}
if r.bearerToken != "" {
req.Header.Set("Authorization", "Bearer "+r.bearerToken)
}