diff --git a/src/Thinktecture.Relay.Abstractions/Extensions/ClientRequestExtensions.cs b/src/Thinktecture.Relay.Abstractions/Extensions/ClientRequestExtensions.cs index b6739f148..f63806bbd 100644 --- a/src/Thinktecture.Relay.Abstractions/Extensions/ClientRequestExtensions.cs +++ b/src/Thinktecture.Relay.Abstractions/Extensions/ClientRequestExtensions.cs @@ -49,12 +49,16 @@ public static T CreateResponse(this IClientRequest request, HttpStatusCode? h HttpHeaders = new Dictionary(StringComparer.OrdinalIgnoreCase), }; + if (httpStatusCode is not null) + { + response.HttpStatusCode = httpStatusCode.Value; + } + if (httpStatusCode == null || (int)httpStatusCode.GetValueOrDefault(HttpStatusCode.Continue) < 400) return response; response.OriginalBodySize = 0; response.BodySize = 0; - response.HttpStatusCode = httpStatusCode.Value; response.RequestFailed = true; return response;