Skip to content

Commit

Permalink
Merge pull request #9 from bhavishyachandra/master
Browse files Browse the repository at this point in the history
proxy headers
  • Loading branch information
twitchax authored Apr 19, 2019
2 parents 916bea7 + 2830a26 commit 85660de
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/Core/Helpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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) &&
Expand Down

0 comments on commit 85660de

Please sign in to comment.