Fix for "complex" content type in HTTP Endpoint and HTTP Send request
This commit is contained in:
parent
89e1c604c9
commit
4384bdaab4
|
|
@ -86,8 +86,9 @@ namespace Elsa.Activities.Http
|
|||
|
||||
private IHttpRequestBodyParser SelectContentParser(string contentType)
|
||||
{
|
||||
string? simpleContentType = contentType?.Split(';').First();
|
||||
var formatters = _parsers.OrderByDescending(x => x.Priority).ToList();
|
||||
return formatters.FirstOrDefault(x => x.SupportedContentTypes.Contains(contentType, StringComparer.OrdinalIgnoreCase)) ?? formatters.Last();
|
||||
return formatters.FirstOrDefault(x => x.SupportedContentTypes.Contains(simpleContentType, StringComparer.OrdinalIgnoreCase)) ?? formatters.Last();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -125,9 +125,10 @@ namespace Elsa.Activities.Http
|
|||
|
||||
private IHttpResponseBodyParser SelectContentParser(string contentType)
|
||||
{
|
||||
string? simpleContentType = contentType?.Split(';').First();
|
||||
var formatters = _parsers.OrderByDescending(x => x.Priority).ToList();
|
||||
return formatters.FirstOrDefault(
|
||||
x => x.SupportedContentTypes.Contains(contentType, StringComparer.OrdinalIgnoreCase)
|
||||
x => x.SupportedContentTypes.Contains(simpleContentType, StringComparer.OrdinalIgnoreCase)
|
||||
) ?? formatters.Last();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue