Fixed: (Cardigann) Search path redirect

Fixes #1102
pull/1121/head
Qstick 2 years ago
parent 25217c0ee8
commit 0a111e7572

@ -945,6 +945,11 @@ namespace NzbDrone.Core.Indexers.Cardigann
public bool CheckIfLoginIsNeeded(HttpResponse response) public bool CheckIfLoginIsNeeded(HttpResponse response)
{ {
if (_definition.Login == null || _definition.Login.Test == null)
{
return false;
}
if (response.HasHttpRedirect) if (response.HasHttpRedirect)
{ {
var domainHint = GetRedirectDomainHint(response); var domainHint = GetRedirectDomainHint(response);
@ -958,11 +963,6 @@ namespace NzbDrone.Core.Indexers.Cardigann
return true; return true;
} }
if (_definition.Login == null || _definition.Login.Test == null)
{
return false;
}
if (response.HasHttpError) if (response.HasHttpError)
{ {
return true; return true;
@ -1124,6 +1124,8 @@ namespace NzbDrone.Core.Indexers.Cardigann
var request = new CardigannRequest(requestbuilder.SetEncoding(_encoding).Build(), variables, searchPath); var request = new CardigannRequest(requestbuilder.SetEncoding(_encoding).Build(), variables, searchPath);
request.HttpRequest.AllowAutoRedirect = searchPath.Followredirect;
yield return request; yield return request;
} }
} }

@ -2,6 +2,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.Specialized; using System.Collections.Specialized;
using System.Linq; using System.Linq;
using DryIoc;
using NzbDrone.Common.Extensions; using NzbDrone.Common.Extensions;
using NzbDrone.Common.Http; using NzbDrone.Common.Http;
using NzbDrone.Core.IndexerSearch.Definitions; using NzbDrone.Core.IndexerSearch.Definitions;
@ -268,7 +269,10 @@ namespace NzbDrone.Core.Indexers.Newznab
parameters.Add("offset", searchCriteria.Offset.ToString()); parameters.Add("offset", searchCriteria.Offset.ToString());
} }
yield return new IndexerRequest(string.Format("{0}&{1}", baseUrl, parameters.GetQueryString()), HttpAccept.Rss); var request = new IndexerRequest(string.Format("{0}&{1}", baseUrl, parameters.GetQueryString()), HttpAccept.Rss);
request.HttpRequest.AllowAutoRedirect = true;
yield return request;
} }
private static string NewsnabifyTitle(string title) private static string NewsnabifyTitle(string title)

@ -355,8 +355,6 @@ namespace NzbDrone.Core.Indexers
request.HttpRequest.LogResponseContent = true; request.HttpRequest.LogResponseContent = true;
} }
request.HttpRequest.AllowAutoRedirect = FollowRedirect;
var originalUrl = request.Url; var originalUrl = request.Url;
Cookies = GetCookies(); Cookies = GetCookies();

Loading…
Cancel
Save