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

Provide access to servletPath in ServletRequestPathUtils #34379

Closed
rstoyanchev opened this issue Feb 7, 2025 · 0 comments
Closed

Provide access to servletPath in ServletRequestPathUtils #34379

rstoyanchev opened this issue Feb 7, 2025 · 0 comments
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Milestone

Comments

@rstoyanchev
Copy link
Contributor

rstoyanchev commented Feb 7, 2025

ServletRequestPathUtils exposes methods to parse and cache the request path. The expectation is to match the application portion of the path, excluding common parts (applicationContext, servletPath).

Spring Security is making comprehensive changes to use PathPatternParser for path matching in spring-projects/spring-security#16417. However, as it may need to secure endpoints in a multiple Servlet deployment scenario, it needs to be able to match the servletPath.

ServletRequestPathUtils has some specific logic to determine the servletPath that targets the multiple Servlets deployment scenario with mapping by path prefix. It would be useful to expose that so that Spring Security can access the servletPath and use it for matching purposes in the same way that Spring MVC does. It would also make possible for the PathPatternRequestMatcher in spring-projects/spring-security#16499 to use ServletRequestPathUtils rather than replicate what it does.

@rstoyanchev rstoyanchev added in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement labels Feb 7, 2025
@rstoyanchev rstoyanchev added this to the 6.2.3 milestone Feb 7, 2025
@rstoyanchev rstoyanchev self-assigned this Feb 7, 2025
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) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

1 participant