diff --git a/src/NzbDrone.Common/Http/HttpClient.cs b/src/NzbDrone.Common/Http/HttpClient.cs index f89307d5e..c05a86d63 100644 --- a/src/NzbDrone.Common/Http/HttpClient.cs +++ b/src/NzbDrone.Common/Http/HttpClient.cs @@ -200,7 +200,7 @@ namespace NzbDrone.Common.Http private void HandleResponseCookies(HttpResponse response, CookieContainer cookieContainer) { - var cookieHeaders = response.GetCookieHeaders(); + var cookieHeaders = response.Cookies; if (cookieHeaders.Empty()) { return; @@ -212,11 +212,11 @@ namespace NzbDrone.Common.Http { var persistentCookieContainer = _cookieContainerCache.Get("container", () => new CookieContainer()); - foreach (var cookieHeader in cookieHeaders) + foreach (Cookie cookieHeader in cookieHeaders) { try { - persistentCookieContainer.SetCookies((Uri)response.Request.Url, cookieHeader); + persistentCookieContainer.Add((Uri)response.Request.Url, cookieHeader); } catch (Exception ex) { diff --git a/src/NzbDrone.Common/Http/HttpResponse.cs b/src/NzbDrone.Common/Http/HttpResponse.cs index 85ebe9ffc..db498e186 100644 --- a/src/NzbDrone.Common/Http/HttpResponse.cs +++ b/src/NzbDrone.Common/Http/HttpResponse.cs @@ -59,11 +59,6 @@ namespace NzbDrone.Common.Http StatusCode == HttpStatusCode.TemporaryRedirect || StatusCode == HttpStatusCode.Found; - public string[] GetCookieHeaders() - { - return Headers.GetValues("Set-Cookie") ?? Array.Empty(); - } - public Dictionary GetCookies() { var result = new Dictionary();