mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-04-18 14:39:45 +02:00
AllowOnlyDefinedHttpStatusCodeInResponse (#422)
This commit is contained in:
@@ -104,12 +104,12 @@ namespace WireMock.Owin.Mappers
|
||||
|
||||
private int MapStatusCode(int code)
|
||||
{
|
||||
if (_options.AllowAnyHttpStatusCodeInResponse == true || Enum.IsDefined(typeof(HttpStatusCode), code))
|
||||
if (_options.AllowOnlyDefinedHttpStatusCodeInResponse == true && !Enum.IsDefined(typeof(HttpStatusCode), code))
|
||||
{
|
||||
return code;
|
||||
return (int)HttpStatusCode.OK;
|
||||
}
|
||||
|
||||
return (int)HttpStatusCode.OK;
|
||||
return code;
|
||||
}
|
||||
|
||||
private bool IsFault(ResponseMessage responseMessage)
|
||||
|
||||
Reference in New Issue
Block a user