Closed risogolo closed 1 month ago
Unknown headers are copied by default when establishing WebSocket connections.
Can you create a small runnable example that reproduces the issue?
Closing as this is not actionable by us at the momemnt. Feel free to reopen if/when you have more info/questions.
Describe the bug
I need to send/forward custom HTTP header during SignalR/Websockets connection negotiation, this works on my local SignalR Hub and console application (WebSockets client), but if I put Yarp in between then it does not work, the thing is that I dont see these custom added HTTP headers in incoming request (RequestTransformContext), so they are not being forwarded which is my goal.
To Reproduce
When creating SignalR client connection I am adding WithUrl like:
var connection = new HubConnectionBuilder() .WithUrl(new Uri($"{url.TrimEnd('/')}/v2/chat"), options => { options.AccessTokenProvider = accessTokenProvider; options.Headers.Add("company-id", headerProvider.GetCompanyId()); })
then in Yarp add into the HTTP request processing pipeline
app.UseWebSockets();
as mentioned I dont see company-id header in incoming request in RequestTransformContext even though I have
"RequestHeadersCopy": "true"
in configurationFurther technical details
I am using yarp 2.1.0 Windows 11