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

jsessionid breaks request mappings when removeSemicolonContent is turned off #25864

Closed
jkissel opened this issue Oct 6, 2020 · 2 comments
Closed
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) status: backported An issue that has been backported to maintenance branches type: regression A bug that is also a regression
Milestone

Comments

@jkissel
Copy link

jkissel commented Oct 6, 2020

Affects: v5.2.9 (and probably v5.3.0)


In our project, we setup the UrlPathHelper to not remove semicolon content, because we want to use matrix variables. Until and including v5.2.8, the jsessionid parameter was still removed from URLs. The parameter is injected into the URL by servlet containers if cookies cannot be used for session tracking (e.g. because the client doesn't accept cookies) or if the server was configured explicitly to use the URL for session tracking.

Starting with v5.2.9, the parameter is not removed anymore, which breaks our request mappings: For example a request to /data;jsessionId=1234 cannot be mapped to the endpoint with the @RequestMapping("/data") because of the additional jsessionid parameter and the result is an HTTP status 404 (Not Found).

The change was introduced with commit 899761f0a8890353dc01f10d2af96ae192f3e655 where the removeJsessionid() method was removed without (obvious) replacement.

Thx for your help to make the request mappings work again.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Oct 6, 2020
@rstoyanchev rstoyanchev self-assigned this Oct 7, 2020
@rstoyanchev
Copy link
Contributor

The commit was meant to be self-sufficient with jsessionId simply ignored later when injecting @MatrixVariable values but it also impacts mappings for methods that don't expect any such parameters and so it is a regression.

As a workaround in the mean time probably best to insert your own UrlPathHelper and override removeSemicolonContent.

@rstoyanchev rstoyanchev added in: web Issues in web modules (web, webmvc, webflux, websocket) type: regression A bug that is also a regression and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Oct 7, 2020
@rstoyanchev rstoyanchev added this to the 5.2.10 milestone Oct 7, 2020
@spring-projects-issues spring-projects-issues added status: backported An issue that has been backported to maintenance branches and removed for: backport-to-5.1.x labels Oct 7, 2020
@rstoyanchev rstoyanchev changed the title jsessionid URL parameter breaks request mappings jsessionid breaks request mappings when removeSemicolonContent is turned off Oct 7, 2020
@jkissel
Copy link
Author

jkissel commented Oct 7, 2020

As a workaround in the mean time probably best to insert your own UrlPathHelper and override removeSemicolonContent.

Makes sense 👍 And thank you for the quick fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) status: backported An issue that has been backported to maintenance branches type: regression A bug that is also a regression
Projects
None yet
Development

No branches or pull requests

4 participants