fix SignalR http2 SkipNegotiation error#62940
Conversation
…sion is not http2
There was a problem hiding this comment.
Pull Request Overview
This PR fixes an issue where SignalR clients using HTTP/2 with SkipNegotiation mode were not properly creating an HttpClient, which caused errors. The fix ensures that HttpClient is always created regardless of the negotiation and transport settings.
- Removes conditional logic that prevented
HttpClientcreation in certain scenarios - Ensures
HttpClientis available for all transport configurations
Comments suppressed due to low confidence (1)
src/SignalR/clients/csharp/Http.Connections.Client/src/HttpConnection.cs:151
- The removal of the conditional logic that prevented HttpClient creation in SkipNegotiation + WebSockets-only scenarios should be covered by tests to ensure this fix works correctly and prevent regression.
_httpClient = CreateHttpClient();
|
Hi, any progress in fixing this? |
|
I verified locally, but not sure if that's the way the team wants to adopt and not sure about the test cases that should be added |
BrennanConroy
left a comment
There was a problem hiding this comment.
Can you update the _httpClient field to be non-nullable, fix the NegotiateAsync call to not use !, and not use ? in the Dispose call?
|
Hello, is this PR still active?
Please let me know if I can help with this one @WeihanLi @BrennanConroy |

fix SignalR http2 SkipNegotiation error
Description
Creating
HttpClientfor WebSocketSkipNegotiationmode alsoFixes #59303