Fixed: (Cardigann) Add check for request.inputs, since are null when pathselector is used

Fixes #1158
This commit is contained in:
Bogdan 2023-04-11 18:31:11 +03:00
parent c6ed5d65e0
commit 451f60319f

View file

@ -728,16 +728,19 @@ protected async Task<HttpResponse> HandleRequest(RequestBlock request, Dictionar
pairs = new Dictionary<string, string>();
}
foreach (var input in request.Inputs)
if (request.Inputs != null)
{
var value = ApplyGoTemplateText(input.Value, variables);
if (method == HttpMethod.Get)
foreach (var input in request.Inputs)
{
queryCollection.Add(input.Key, value);
}
else if (method == HttpMethod.Post)
{
pairs.Add(input.Key, value);
var value = ApplyGoTemplateText(input.Value, variables);
if (method == HttpMethod.Get)
{
queryCollection.Add(input.Key, value);
}
else if (method == HttpMethod.Post)
{
pairs.Add(input.Key, value);
}
}
}