mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-04-10 18:56:50 +02:00
Fix issues with Proxy mode and Binary Request Bodies (#334)
* Add Test for Proxy with binary request * Fix binary parsing in BodyParser * Fix binary Matching in RequestMessageBodyMatcher * Improved Binary Matching in RequestMessageBodyMatcher * BodyParser: Add test for Content Autodetection * RequestMessageBodyMatcherTests: Make Code more pretty :) * BodyParserChanges: Revert white space changes * Fixed test for different behavior in request matching
This commit is contained in:
@@ -145,17 +145,17 @@ namespace WireMock.Matchers.Request
|
||||
|
||||
if (Func != null)
|
||||
{
|
||||
return MatchScores.ToScore(requestMessage?.BodyData?.DetectedBodyType == BodyType.String && Func(requestMessage.BodyData.BodyAsString));
|
||||
return MatchScores.ToScore(Func(requestMessage?.BodyData?.BodyAsString));
|
||||
}
|
||||
|
||||
if (JsonFunc != null)
|
||||
{
|
||||
return MatchScores.ToScore(requestMessage?.BodyData?.DetectedBodyType == BodyType.Json && JsonFunc(requestMessage.BodyData.BodyAsJson));
|
||||
return MatchScores.ToScore(JsonFunc(requestMessage?.BodyData?.BodyAsJson));
|
||||
}
|
||||
|
||||
if (DataFunc != null)
|
||||
{
|
||||
return MatchScores.ToScore(requestMessage?.BodyData?.DetectedBodyType == BodyType.Bytes && DataFunc(requestMessage.BodyData.BodyAsBytes));
|
||||
return MatchScores.ToScore(DataFunc(requestMessage?.BodyData?.BodyAsBytes));
|
||||
}
|
||||
|
||||
return MatchScores.Mismatch;
|
||||
|
||||
Reference in New Issue
Block a user