diff --git a/src/Core/AspNetCore.Proxy.csproj b/src/Core/AspNetCore.Proxy.csproj index 79afcd5..b94f51a 100644 --- a/src/Core/AspNetCore.Proxy.csproj +++ b/src/Core/AspNetCore.Proxy.csproj @@ -1,6 +1,6 @@ - 2.1.0 + 2.1.1 AspNetCore.Proxy AspNetCore.Proxy bin\AspNetCore.Proxy.xml diff --git a/src/Core/Helpers.cs b/src/Core/Helpers.cs index 765fb15..d3113e6 100644 --- a/src/Core/Helpers.cs +++ b/src/Core/Helpers.cs @@ -62,11 +62,10 @@ private static HttpRequestMessage CreateProxyHttpRequest(this HttpContext contex // Copy the request headers. foreach (var header in request.Headers) - { if (!requestMessage.Headers.TryAddWithoutValidation(header.Key, header.Value.ToArray())) requestMessage.Content?.Headers.TryAddWithoutValidation(header.Key, header.Value.ToArray()); - } + // Write to request conent, when necessary. if (!HttpMethods.IsGet(requestMethod) && !HttpMethods.IsHead(requestMethod) && !HttpMethods.IsDelete(requestMethod) &&