Repository navigation
[#2969] - Propagate PathMatchingFilterChainResolver's PatternMatcher to PathMatchingFilters - #2970
Closed
4n86rakam1 wants to merge 2 commits into
Closed
4n86rakam1 wants to merge 2 commits into
4n86rakam1 wants to merge 2 commits into
Conversation
…tcher to PathMatchingFilters PathMatchingFilterChainResolver.setPathMatcher() replaced only the resolver's matcher, while each PathMatchingFilter re-matched the path with its own AntPathMatcher. With a non-Ant matcher the resolver selected a chain whose filters then skipped the request. Apply the resolver's matcher to the PathMatchingFilters in its FilterChainManager, as ShiroFilterFactoryBean already does for Spring. fixes apache#2969 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Drop the comment that repeated the Javadoc, the null check on getFilters() that DefaultFilterChainManager never needs, and the test for re-applying the matcher, which only backed the removed Javadoc note. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
Thank you for your contribution. |
8 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PathMatchingFilterChainResolver.setPathMatcher()only replaced the resolver's own matcher. EachPathMatchingFilterkept its privateAntPathMatcherand re-matched the request path inpreHandle. With a different matcher (for exampleRegExPatternMatcherand/secure/[^/]+) the resolver selected the chain, but the filter's Ant matcher did not match the pattern, sopreHandlereturnedtrueand the filter did nothing.The resolver now applies its matcher to every
PathMatchingFilterin itsFilterChainManager, both insetPathMatcher()and insetFilterChainManager(). This mirrors whatShiroFilterFactoryBeanalready does for Spring (#2928).Tests: two new cases in
PathMatchingFilterChainResolverTestuse aRegExPatternMatcherand a realPathMatchingFilter. They fail before the change and pass after it../mvnw -pl web -am verifypasses (241 tests inweb).fixes #2969
[#XXX] - Fixes bug in SessionManager.fixes #XXXif merging the PR should close a related issue.mvn verifyto make sure basic checks pass.