From 8e597c8179136cb94794d716888c556f4d790f1c Mon Sep 17 00:00:00 2001 From: Qstick Date: Mon, 21 Jun 2021 21:22:56 -0400 Subject: [PATCH] Fixed: Allow redirect and set referer for Anthelion --- src/NzbDrone.Core/Indexers/Definitions/Anthelion.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/NzbDrone.Core/Indexers/Definitions/Anthelion.cs b/src/NzbDrone.Core/Indexers/Definitions/Anthelion.cs index 152a1c5d9..9364280d9 100644 --- a/src/NzbDrone.Core/Indexers/Definitions/Anthelion.cs +++ b/src/NzbDrone.Core/Indexers/Definitions/Anthelion.cs @@ -52,7 +52,8 @@ namespace NzbDrone.Core.Indexers.Definitions { var requestBuilder = new HttpRequestBuilder(LoginUrl) { - LogResponseContent = true + LogResponseContent = true, + AllowAutoRedirect = true }; requestBuilder.Method = HttpMethod.POST; @@ -69,6 +70,13 @@ namespace NzbDrone.Core.Indexers.Definitions .SetHeader("Content-Type", "multipart/form-data") .Build(); + var headers = new NameValueCollection + { + { "Referer", LoginUrl } + }; + + authLoginRequest.Headers.Add(headers); + var response = await ExecuteAuth(authLoginRequest); if (!response.Content.Contains("logout.php"))