Skip to content

FELIX-6873 : Match ERROR filters against the error servlet path - #582

Merged
paulrutter merged 1 commit into
masterfrom
FELIX-6873-error-filter-path
Oct 29, 2026
Merged

paulrutter merged 1 commit into
masterfrom
FELIX-6873-error-filter-path

Conversation

@paulrutter

Copy link
Copy Markdown
Contributor

Fixes FELIX-6873.

ERROR dispatch matched URL-pattern filters against the original request URI instead of the path of the selected error servlet. This is inconsistent with FORWARD/INCLUDE and with servlet containers.

Change

  • ServletResponseWrapper now matches ERROR filters against the error servlet's own patterns (/foo/* becomes /foo, / and empty become /).
  • Extension patterns have no path to match; an error servlet without patterns is matched by servlet-name filters only.
  • FilterRegistry / PerContextHandlerRegistry get a getFilterHandlers(..., String[]) overload; the existing single-URI method delegates to it.

Behaviour change: ERROR filters that relied on matching the original request URI no longer match. Worth a release note.

Tests: new FilterRegistryTest.testErrorFilterMatchesErrorServletPath and ServletResponseWrapperTest; full http/base suite passes (147 tests, JDK 21).

🤖 Generated with Claude Code

ERROR dispatch matched URL-pattern filters against the original request
URI. Match them against the paths of the selected error servlet instead,
consistent with FORWARD and INCLUDE. An error servlet without a pattern
(or with only extension patterns) is only matched by servlet name filters.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@paulrutter
paulrutter requested a review from cziegeler October 27, 2026 08:18

@cziegeler cziegeler left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm, thanks

@paulrutter
paulrutter merged commit e8fba9f into master Oct 29, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants