-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Malformed scheme logical expression check in WebSocket ClientUpgradeRequest #6407
Comments
Referenced lines ... Note: it's the same logic in 10.0.5 This is surprising, we have many tests using this code that are working just fine. In Jetty 9.4.42 we have different logic here. Also, where's the identification of the secure flag on 10+? |
This looks like it was bad refactor from PR #3740. Looks like the URI of the upgrade request is never used. All of the @steffzahn this is something that should be fixed for the next release, but as a workaround just create the |
Well, at least I cannot find any code ( test code or other code ) in the jetty project, using the constructor ClientUpgradeRequest(URI uri). Apparently a test case is missing. |
...
Well that does not work directly, since the fields are final and private. But it was possible to create a hack using reflection. |
@steffzahn you should not use reflection to set the fields. They do not need to be set, you can use the no-arg constructor instead as these fields on The |
Thank you, that hint works for me. |
…deprecate it Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
…RequestUri Issue #6407 - Fix URI validation for WebSocket ClientUpgradeRequest
Jetty version(s) 11.0.5
Java version/vendor
(use: java -version)
15.0.1OS type/version Windows 10
Description
in the class ClientUpgradeRequest there is a malformed check in the constructor:
if (!HttpScheme.WS.is(scheme) || !HttpScheme.WSS.is(scheme))
That should obviously be
if (!HttpScheme.WS.is(scheme) && !HttpScheme.WSS.is(scheme))
How to reproduce?
Perform a websocket upgrade request
The text was updated successfully, but these errors were encountered: