Skip to content

Conversation

lachlan-roberts
Copy link
Contributor

Closes #13335

This PR prevents HttpUpgradeHandler.init being called from within the HttpServletRequest.upgrade implementation, this should only instantiate the HttpUpgradeHandler.
see https://jakarta.ee/specifications/servlet/6.1/jakarta-servlet-spec-6.1#upgrade-processing

After exiting the service method of the servlet, the servlet container completes the processing of all filters and marks the connection to be handled by the HttpUpgradeHandler. It then calls the HttpUpgradeHandler's init method, passing a WebConnection to allow the protocol handler access to the data streams.

This PR also changes the HttpServletRequest.upgrade implementation to automatically set required headers for the upgrade.

@lachlan-roberts lachlan-roberts self-assigned this Sep 17, 2025
@lachlan-roberts lachlan-roberts marked this pull request as ready for review September 24, 2025 05:55
@lachlan-roberts
Copy link
Contributor Author

@gregw can you please review this PR, currently only for EE11, but I can duplicate these changes for EE10 once we get the EE11 code reviewed.

@lachlan-roberts lachlan-roberts moved this to 👀 In review in Jetty 12.1.2 - FROZEN Sep 24, 2025
@joakime joakime moved this to 👀 In review in Jetty 12.1.3 Oct 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 👀 In review
Development

Successfully merging this pull request may close these issues.

Servlet Upgrade Support is too eager
1 participant