Skip to content

Commit bf5f40b

Browse files
In Websocket proxy, don't forward User-Agent. Fixes aspnet#1469.
1 parent a515f6b commit bf5f40b

File tree

1 file changed

+3
-1
lines changed
  • src/Microsoft.AspNetCore.SpaServices.Extensions/Proxying

1 file changed

+3
-1
lines changed

src/Microsoft.AspNetCore.SpaServices.Extensions/Proxying/SpaProxy.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ internal static class SpaProxy
2222
private const int DefaultWebSocketBufferSize = 4096;
2323
private const int StreamCopyBufferSize = 81920;
2424

25-
private static readonly string[] NotForwardedWebSocketHeaders = new[] { "Connection", "Host", "Upgrade", "Sec-WebSocket-Key", "Sec-WebSocket-Version" };
25+
// Don't forward User-Agent because of https://github.com/aspnet/JavaScriptServices/issues/1469
26+
// Others just aren't applicable in proxy scenarios
27+
private static readonly string[] NotForwardedWebSocketHeaders = new[] { "Connection", "Host", "User-Agent", "Upgrade", "Sec-WebSocket-Key", "Sec-WebSocket-Version" };
2628

2729
public static HttpClient CreateHttpClientForProxy(TimeSpan requestTimeout)
2830
{

0 commit comments

Comments
 (0)