mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2026-04-27 23:16:58 -04:00
Fixed: (Cardigann) Sites that use POST search not sending form params
Fixes #367
This commit is contained in:
@@ -8,7 +8,13 @@ namespace NzbDrone.Core.Indexers.Cardigann
|
||||
public Dictionary<string, object> Variables { get; private set; }
|
||||
|
||||
public CardigannRequest(string url, HttpAccept httpAccept, Dictionary<string, object> variables)
|
||||
: base(url, httpAccept)
|
||||
: base(url, httpAccept)
|
||||
{
|
||||
Variables = variables;
|
||||
}
|
||||
|
||||
public CardigannRequest(HttpRequest httpRequest, Dictionary<string, object> variables)
|
||||
: base(httpRequest)
|
||||
{
|
||||
Variables = variables;
|
||||
}
|
||||
|
||||
@@ -933,7 +933,20 @@ namespace NzbDrone.Core.Indexers.Cardigann
|
||||
|
||||
_logger.Info($"Adding request: {searchUrl}");
|
||||
|
||||
var request = new CardigannRequest(searchUrl, HttpAccept.Html, variables);
|
||||
var requestbuilder = new HttpRequestBuilder(searchUrl);
|
||||
|
||||
requestbuilder.Method = method;
|
||||
|
||||
// Add FormData for searchs that POST
|
||||
if (method == HttpMethod.POST)
|
||||
{
|
||||
foreach (var param in queryCollection)
|
||||
{
|
||||
requestbuilder.AddFormParameter(param.Key, param.Value);
|
||||
}
|
||||
}
|
||||
|
||||
var request = new CardigannRequest(requestbuilder.Build(), variables);
|
||||
|
||||
// send HTTP request
|
||||
if (search.Headers != null)
|
||||
@@ -944,8 +957,6 @@ namespace NzbDrone.Core.Indexers.Cardigann
|
||||
}
|
||||
}
|
||||
|
||||
request.HttpRequest.Method = method;
|
||||
|
||||
yield return request;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user