Fix cdn connection issue

This commit is contained in:
Ben Sarmiento
2023-11-28 13:17:42 +01:00
parent a42a5eeb80
commit 9f5e1a1ec5
2 changed files with 3 additions and 3 deletions

View File

@@ -25,10 +25,10 @@ type HTTPClient struct {
}
func (r *HTTPClient) Do(req *http.Request) (*http.Response, error) {
req.Close = true
if r.config != nil && strings.Contains(req.Host, "download.real-debrid.") {
prefHost := r.config.GetRandomPreferredHost()
if prefHost != "" {
req.Host = prefHost
req.URL.Host = prefHost
}
}