Skip to content

Commit

Permalink
SpaProxy - remove NotForwardedHttpHeaders
Browse files Browse the repository at this point in the history
- reverts 4eebc16
- closes #29478
  • Loading branch information
Matthew Wong committed May 14, 2021
1 parent 8674585 commit cc45d1b
Showing 1 changed file with 0 additions and 8 deletions.
Expand Up @@ -22,9 +22,6 @@ internal static class SpaProxy
private const int DefaultWebSocketBufferSize = 4096;
private const int StreamCopyBufferSize = 81920;

// https://github.com/dotnet/aspnetcore/issues/16797
private static readonly string[] NotForwardedHttpHeaders = new[] { "Connection" };

// Don't forward User-Agent/Accept because of https://github.com/aspnet/JavaScriptServices/issues/1469
// Others just aren't applicable in proxy scenarios
private static readonly string[] NotForwardedWebSocketHeaders = new[] { "Accept", "Connection", "Host", "User-Agent", "Upgrade", "Sec-WebSocket-Key", "Sec-WebSocket-Protocol", "Sec-WebSocket-Version" };
Expand Down Expand Up @@ -135,11 +132,6 @@ private static HttpRequestMessage CreateProxyHttpRequest(HttpContext context, Ur
// Copy the request headers
foreach (var header in request.Headers)
{
if (NotForwardedHttpHeaders.Contains(header.Key, StringComparer.OrdinalIgnoreCase))
{
continue;
}

if (!requestMessage.Headers.TryAddWithoutValidation(header.Key, header.Value.ToArray()) && requestMessage.Content != null)
{
requestMessage.Content?.Headers.TryAddWithoutValidation(header.Key, header.Value.ToArray());
Expand Down

0 comments on commit cc45d1b

Please sign in to comment.