Skip to content

RequestMatcherDelegatingWebInvocationPrivilegeEvaluator doesn't provided access to the ServletContext #10779

Closed
@philwebb

Description

@philwebb

Describe the bug
See spring-projects/spring-boot#29564 for details.

The recently introduced RequestMatcherDelegatingWebInvocationPrivilegeEvaluator class creates a new FilterInvocation in the getDelegate method. This invocation has a DummyRequest which cannot provide access to the ServletContext. This means that Spring Boot's ApplicationContextRequestMatcher cannot get the WebApplicationContext.

This feels quite similar to #10208 which was fixed by making the WebInvocationPrivilegeEvaluator ServletAware.

To Reproduce
Run tests from the sample application at https://github.com/jeffbswope/null-servletcontext-errorpagefilter

Expected behavior
The tests should pass

Sample
https://github.com/jeffbswope/null-servletcontext-errorpagefilter

Metadata

Metadata

Labels

in: webAn issue in web modules (web, webmvc)status: backportedAn issue that has been backported to maintenance branchestype: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions