mirror of
https://github.com/Prowlarr/Prowlarr
synced 2026-04-19 19:30:47 +02:00
Fixed: (Cardigann) Sites that use POST search not sending form params
Fixes #367
This commit is contained in:
parent
026a503d5f
commit
0508dd2b66
2 changed files with 21 additions and 4 deletions
|
|
@ -8,7 +8,13 @@ public class CardigannRequest : IndexerRequest
|
|||
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 @@ private IEnumerable<IndexerRequest> GetRequest(Dictionary<string, object> variab
|
|||
|
||||
_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 @@ private IEnumerable<IndexerRequest> GetRequest(Dictionary<string, object> variab
|
|||
}
|
||||
}
|
||||
|
||||
request.HttpRequest.Method = method;
|
||||
|
||||
yield return request;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue