-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can not get request headers in Hub(Context.GetHttpContext) using Azure SignalR #1495
Comments
I am seeing this too. I set custom headers when creating my hub connection in a Blazor WASM app.
But this custom header is not present in |
@MaxxDelusional I did a quick try and the headers are included in Could you provide me with a minimum project that can repro the issue you described? |
I see this too ;), also in a blazor wasm project. The headers are included within the negotiate call. I can not observe the headers within the second request made by the Microsoft.AspNetCore.SignalR.Client.Core.HubConnection. |
@vicancy where are you reading the headers in your hub? Are they available in OnConnectedAsync? I believe the problem might be caused by web sockets. I am not sure that web sockets support custom headers. |
@MaxxDelusional It's indeed in OnConnctedAsync, but I am using a normal SignalR project instead of a blazor WASM project though. A minimum project that can repro the issue is very much appreciated. |
You can't set headers on WebSocket requests in the browser. This is a limitation of the browser and not something SignalR can fix. See whatwg/websockets#16 if you're passionate about browsers supporting this. |
Thanks for your information, I think I should set the data on sending. |
I am using Azure SignalR, and i can not get request headers in my hub class. I was trying to do that using Context.GetHttpContext() method. but it was not successful. Can anyone help me? Thank you.
The text was updated successfully, but these errors were encountered: