-
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
Issue #12429 - case-insensitive headers for websocket #12441
Issue #12429 - case-insensitive headers for websocket #12441
Conversation
Signed-off-by: Lachlan Roberts <[email protected]>
jetty-core/jetty-http/src/main/java/org/eclipse/jetty/http/HttpFields.java
Outdated
Show resolved
Hide resolved
...ain/java/org/eclipse/jetty/websocket/client/internal/DelegatedJettyClientUpgradeRequest.java
Outdated
Show resolved
Hide resolved
...server/src/main/java/org/eclipse/jetty/websocket/server/internal/UpgradeRequestDelegate.java
Show resolved
Hide resolved
Signed-off-by: Lachlan Roberts <[email protected]>
Signed-off-by: Lachlan Roberts <[email protected]>
Signed-off-by: Lachlan Roberts <[email protected]>
Signed-off-by: Lachlan Roberts <[email protected]>
@gregw @joakime I have changed it so that the I have also reviewed the error handling for the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good, but a few niggles
jetty-core/jetty-http/src/main/java/org/eclipse/jetty/http/HttpFieldsMap.java
Outdated
Show resolved
Hide resolved
jetty-core/jetty-http/src/main/java/org/eclipse/jetty/http/HttpFields.java
Outdated
Show resolved
Hide resolved
jetty-core/jetty-http/src/main/java/org/eclipse/jetty/http/HttpFields.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Lachlan Roberts <[email protected]>
…Fields Signed-off-by: Lachlan Roberts <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, but I do think one method is best.
jetty-core/jetty-http/src/main/java/org/eclipse/jetty/http/HttpFields.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Lachlan Roberts <[email protected]>
...-jetty-server/src/main/java/org/eclipse/jetty/websocket/server/ServerWebSocketContainer.java
Outdated
Show resolved
Hide resolved
...erver/src/main/java/org/eclipse/jetty/websocket/server/internal/UpgradeResponseDelegate.java
Outdated
Show resolved
Hide resolved
...in/java/org/eclipse/jetty/ee10/websocket/jakarta/server/JakartaWebSocketServerContainer.java
Show resolved
Hide resolved
...n/java/org/eclipse/jetty/ee10/websocket/jakarta/server/internal/JakartaWebSocketCreator.java
Outdated
Show resolved
Hide resolved
.../java/org/eclipse/jetty/ee10/websocket/jakarta/tests/client/AnnotatedClientEndpointTest.java
Outdated
Show resolved
Hide resolved
...ain/java/org/eclipse/jetty/ee9/websocket/jakarta/server/JakartaWebSocketServerContainer.java
Show resolved
Hide resolved
...in/java/org/eclipse/jetty/ee9/websocket/jakarta/server/internal/JakartaWebSocketCreator.java
Outdated
Show resolved
Hide resolved
...t/java/org/eclipse/jetty/ee9/websocket/jakarta/tests/client/AnnotatedClientEndpointTest.java
Outdated
Show resolved
Hide resolved
...rver/src/main/java/org/eclipse/jetty/ee9/websocket/server/JettyWebSocketServerContainer.java
Outdated
Show resolved
Hide resolved
...rver/src/main/java/org/eclipse/jetty/ee9/websocket/server/JettyWebSocketServerContainer.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Lachlan Roberts <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I replied to your comments.
Signed-off-by: Lachlan Roberts <[email protected]>
cb.failed(t); | ||
if (LOG.isDebugEnabled()) | ||
LOG.debug("Could not create WebSocket endpoint", t); | ||
Response.writeError(req, resp, cb, HttpStatus.INTERNAL_SERVER_ERROR_500, "Could not create WebSocket endpoint"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you check whether cb.failed()
is enough, because the javadocs of creator.createWebSocket()
say to use JettyServerUpgradeResponse. sendError()
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think cb.failed()
is probably better. This will result in the JettyWebSocketServerContainer#upgrade
throwing, which can be caught and handled by their application, or if its not caught will result in a sendError()
anyway.
...server/src/main/java/org/eclipse/jetty/websocket/core/server/internal/CreatorNegotiator.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Lachlan Roberts <[email protected]>
Signed-off-by: Lachlan Roberts <[email protected]>
Signed-off-by: Lachlan Roberts <[email protected]>
Issue #12429
Add a new static method
HttpFields.asMap(HttpFields fields)
and use it everywhere in WebSocket where theHttpFields
are converted into aMap<String, List<String>>
so that the headers in the map are treated as case-insensitive.