diff --git a/src/Core/Helpers.cs b/src/Core/Helpers.cs index 321dd9f..765fb15 100644 --- a/src/Core/Helpers.cs +++ b/src/Core/Helpers.cs @@ -61,11 +61,10 @@ private static HttpRequestMessage CreateProxyHttpRequest(this HttpContext contex var requestMethod = request.Method; // Copy the request headers. - if (requestMessage.Content != null) + foreach (var header in 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()); + if (!requestMessage.Headers.TryAddWithoutValidation(header.Key, header.Value.ToArray())) + requestMessage.Content?.Headers.TryAddWithoutValidation(header.Key, header.Value.ToArray()); } if (!HttpMethods.IsGet(requestMethod) &&