Skip to content

Add tests for PathPatternRequestMatcher request path caching#18721

Merged
rwinch merged 1 commit intospring-projects:mainfrom
coehgns:main
Feb 23, 2026
Merged

Add tests for PathPatternRequestMatcher request path caching#18721
rwinch merged 1 commit intospring-projects:mainfrom
coehgns:main

Conversation

@coehgns
Copy link
Copy Markdown
Contributor

@coehgns coehgns commented Feb 12, 2026

What changed

  • Add tests asserting PathPatternRequestMatcher does not leave a parsed request path behind when it parses one
  • Add test asserting an already-parsed request path remains available after matching
  • Tests cover both cases: request path not pre-parsed vs pre-parsed

Why

PathPatternRequestMatcher parses and caches the request path when needed and should clear it afterwards to avoid
unexpected side effects on downstream components that rely on ServletRequestPathUtils caching.

Verification

  • ./gradlew :spring-security-web:check

Verify parsed request path is cleared when matcher parses it, and preserved when already present.

Signed-off-by: coehgns <modooboiroo@gmail.com>
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Feb 12, 2026
@rwinch rwinch self-assigned this Feb 23, 2026
@rwinch rwinch added in: build An issue in the build in: web An issue in web modules (web, webmvc) and removed status: waiting-for-triage An issue we've not yet triaged labels Feb 23, 2026
@rwinch rwinch added this to the 7.1.0-M3 milestone Feb 23, 2026
@rwinch rwinch merged commit 4d0627e into spring-projects:main Feb 23, 2026
7 checks passed
@rwinch
Copy link
Copy Markdown
Member

rwinch commented Feb 23, 2026

Thank you for your PR! This is now merged into main

@rwinch rwinch added the type: enhancement A general enhancement label Feb 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

in: build An issue in the build in: web An issue in web modules (web, webmvc) type: enhancement A general enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants