This commit is contained in:
Stef Heyenrath
2026-04-20 19:37:09 +02:00
parent 82277c7804
commit 7d1dcc6fb1
8 changed files with 45 additions and 22 deletions

View File

@@ -1,8 +1,7 @@
// Copyright © WireMock.Net
using System.Linq;
using System.Net;
using System.Net.Http;
using JsonConverter.Abstractions;
using WireMock.Util;
namespace WireMock.Http;
@@ -15,7 +14,8 @@ internal static class HttpResponseMessageHelper
Uri originalUri,
bool deserializeJson,
bool decompressGzipAndDeflate,
bool deserializeFormUrlEncoded)
bool deserializeFormUrlEncoded,
IJsonConverter jsonConverter)
{
var responseMessage = new ResponseMessage { StatusCode = (int)httpResponseMessage.StatusCode };
@@ -45,7 +45,8 @@ internal static class HttpResponseMessageHelper
DeserializeJson = deserializeJson,
ContentEncoding = contentEncodingHeader?.FirstOrDefault(),
DecompressGZipAndDeflate = decompressGzipAndDeflate,
DeserializeFormUrlEncoded = deserializeFormUrlEncoded
DeserializeFormUrlEncoded = deserializeFormUrlEncoded,
DefaultJsonConverter = jsonConverter
};
responseMessage.BodyData = await BodyParser.ParseAsync(bodyParserSettings).ConfigureAwait(false);
}

View File

@@ -1,6 +1,5 @@
// Copyright © WireMock.Net
using System.Linq;
using Stef.Validation;
using WireMock.Matchers.Helpers;
using WireMock.Util;

View File

@@ -53,7 +53,8 @@ internal class OwinRequestMapper : IOwinRequestMapper
ContentType = request.ContentType,
DeserializeJson = !options.DisableJsonBodyParsing.GetValueOrDefault(false),
ContentEncoding = contentEncodingHeader?.FirstOrDefault(),
DecompressGZipAndDeflate = !options.DisableRequestBodyDecompressing.GetValueOrDefault(false)
DecompressGZipAndDeflate = !options.DisableRequestBodyDecompressing.GetValueOrDefault(false),
DefaultJsonConverter = options.DefaultJsonSerializer
};
body = await BodyParser.ParseAsync(bodyParserSettings).ConfigureAwait(false);

View File

@@ -48,7 +48,8 @@ internal class ProxyHelper(WireMockServerSettings settings)
originalUri,
deserializeJson,
decompressGzipAndDeflate,
deserializeFormUrlEncoded
deserializeFormUrlEncoded,
_settings.DefaultJsonSerializer
).ConfigureAwait(false);
IMapping? newMapping = null;