Skip to content

Surface SignalR Java WebSocket handshake HTTP errors - #68611

Open
HengYpinn wants to merge 1 commit into
dotnet:mainfrom
HengYpinn:codex/fix-signalr-java-websocket-http-errors
Open

Surface SignalR Java WebSocket handshake HTTP errors#68611
HengYpinn wants to merge 1 commit into
dotnet:mainfrom
HengYpinn:codex/fix-signalr-java-websocket-http-errors

Conversation

@HengYpinn

Copy link
Copy Markdown
  • 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.

When negotiation is skipped, OkHttp reports a failed WebSocket upgrade through onFailure and includes the HTTP response. The Java client was discarding that response, so callers only saw a generic exception and couldn't handle status codes such as 401.

This surfaces non-101 handshake responses as the existing HttpRequestException, including the status code, while keeping the original OkHttp failure as the cause. Failures without an HTTP response keep their current behavior.

I added a regression test that serves a 401 response over a local socket and verifies the status code is available to callers.

Tested with ./gradlew spotlessCheck :test:test --no-daemon.

Fixes #47597

@dotnet-policy-service dotnet-policy-service Bot added the community-contribution Indicates that the PR has been added by a community member label Aug 18, 2026
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Thanks for your PR, @HengYpinn. Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

@HengYpinn
HengYpinn marked this pull request as ready for review August 18, 2026 06:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

[Java Client] HTTP errors during WebSocket handshake not surfaced as HttpRequestExceptions

1 participant