Skip to content

Commit bf5f40b

Browse files
In Websocket proxy, don't forward User-Agent. Fixesaspnet#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
privateconstintDefaultWebSocketBufferSize=4096;
2323
privateconstintStreamCopyBufferSize=81920;
2424

25-
privatestaticreadonlystring[]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+
privatestaticreadonlystring[]NotForwardedWebSocketHeaders=new[]{"Connection","Host","User-Agent","Upgrade","Sec-WebSocket-Key","Sec-WebSocket-Version"};
2628

2729
publicstaticHttpClientCreateHttpClientForProxy(TimeSpanrequestTimeout)
2830
{

0 commit comments

Comments
(0)