Skip to content

fix SignalR http2 SkipNegotiation error #62940

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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

WeihanLi
Copy link
Contributor

@WeihanLi WeihanLi commented Jul 26, 2025

fix SignalR http2 SkipNegotiation error

  • You've read the Contributor Guide and Code of Conduct.
  • You've included unit or integration tests for your change, where applicable.
  • You've included inline docs for your change, where applicable.
  • There's an open issue for the PR that you are making. If you'd like to propose a new feature or change, please open an issue to discuss the change or find an existing issue.

Description

Creating HttpClient for WebSocket SkipNegotiation mode also

Fixes #59303

@github-actions github-actions bot added the area-signalr Includes: SignalR clients and servers label Jul 26, 2025
@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Jul 26, 2025
@WeihanLi WeihanLi marked this pull request as ready for review July 27, 2025 03:32
@Copilot Copilot AI review requested due to automatic review settings July 27, 2025 03:32
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 HttpClient creation in certain scenarios
  • Ensures HttpClient is 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();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-signalr Includes: SignalR clients and servers community-contribution Indicates that the PR has been added by a community member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SignalR Error when connect to http2 server with SkipNegotiation
1 participant