From bf5f40b1edc156566fbd5c7072b3fedbda17607e Mon Sep 17 00:00:00 2001 From: Steve Sanderson Date: Thu, 8 Feb 2018 11:39:28 +0000 Subject: [PATCH] In Websocket proxy, don't forward User-Agent. Fixes #1469. --- .../Proxying/SpaProxy.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Microsoft.AspNetCore.SpaServices.Extensions/Proxying/SpaProxy.cs b/src/Microsoft.AspNetCore.SpaServices.Extensions/Proxying/SpaProxy.cs index 548ac6f..c675625 100644 --- a/src/Microsoft.AspNetCore.SpaServices.Extensions/Proxying/SpaProxy.cs +++ b/src/Microsoft.AspNetCore.SpaServices.Extensions/Proxying/SpaProxy.cs @@ -22,7 +22,9 @@ namespace Microsoft.AspNetCore.SpaServices.Extensions.Proxy private const int DefaultWebSocketBufferSize = 4096; private const int StreamCopyBufferSize = 81920; - private static readonly string[] NotForwardedWebSocketHeaders = new[] { "Connection", "Host", "Upgrade", "Sec-WebSocket-Key", "Sec-WebSocket-Version" }; + // Don't forward User-Agent because of https://github.com/aspnet/JavaScriptServices/issues/1469 + // Others just aren't applicable in proxy scenarios + private static readonly string[] NotForwardedWebSocketHeaders = new[] { "Connection", "Host", "User-Agent", "Upgrade", "Sec-WebSocket-Key", "Sec-WebSocket-Version" }; public static HttpClient CreateHttpClientForProxy(TimeSpan requestTimeout) {