mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-04-27 02:38:30 +02:00
@@ -59,14 +59,19 @@ namespace WireMock.Util
|
||||
|
||||
private static readonly JsonSerializerSettings JsonSerializerSettings = new JsonSerializerSettings { DateParseHandling = DateParseHandling.None };
|
||||
|
||||
public static bool ShouldParseBody([CanBeNull] string method)
|
||||
public static bool ShouldParseBody([CanBeNull] string httpMethod, bool allowBodyForAllHttpMethods)
|
||||
{
|
||||
if (string.IsNullOrEmpty(method))
|
||||
if (string.IsNullOrEmpty(httpMethod))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (BodyAllowedForMethods.TryGetValue(method.ToUpper(), out bool allowed))
|
||||
if (allowBodyForAllHttpMethods)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (BodyAllowedForMethods.TryGetValue(httpMethod.ToUpper(), out bool allowed))
|
||||
{
|
||||
return allowed;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user