Skip to content
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

WebSocketClient should expose upgrade request/response #10749

Closed
sbordet opened this issue Oct 18, 2023 · 0 comments · Fixed by #10761
Closed

WebSocketClient should expose upgrade request/response #10749

sbordet opened this issue Oct 18, 2023 · 0 comments · Fixed by #10761
Assignees

Comments

@sbordet
Copy link
Contributor

sbordet commented Oct 18, 2023

Jetty version(s)
12+

Enhancement Description
WebSocketClient should have an easy API to access (at least) the upgrade response, so that applications can inspect response status code and headers (and possibly content).

This is currently not available because the UpgradeListener passed to WebSocketClient.connect(...) is only invoked when the upgrade is successful.
In case of failures, or non-101 responses, only the WebSocket endpoint is notified, but the response is not available.

lachlan-roberts added a commit that referenced this issue Oct 20, 2023
sbordet added a commit that referenced this issue Nov 20, 2023
…#10761)

* Allow UpgradeListener to see Response in case of non-successful upgrade
* Using a boolean to track whether request was upgraded
* Improved exception handling in HttpUpgraderOverHTTP.
* Avoid using log warnings in CoreClientUpgradeRequest.
* Delayed setting of this.upgraded after the last throw statement.

Signed-off-by: Lachlan Roberts <[email protected]>
Signed-off-by: Simone Bordet <[email protected]>
Co-authored-by: Simone Bordet <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

2 participants