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

RequestMatcherDelegatingWebInvocationPrivilegeEvaluator doesn't provided access to the ServletContext #10779

Closed
philwebb opened this issue Jan 25, 2022 · 0 comments
Assignees
Labels
in: web An issue in web modules (web, webmvc) status: backported An issue that has been backported to maintenance branches type: bug A general bug
Milestone

Comments

@philwebb
Copy link
Member

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

@philwebb philwebb added status: waiting-for-triage An issue we've not yet triaged type: bug A general bug labels Jan 25, 2022
@jzheaux jzheaux added in: web An issue in web modules (web, webmvc) and removed status: waiting-for-triage An issue we've not yet triaged labels Jan 25, 2022
@marcusdacoregio marcusdacoregio added this to the 5.7.0-M2 milestone Jan 31, 2022
marcusdacoregio added a commit that referenced this issue Jan 31, 2022
marcusdacoregio added a commit that referenced this issue Jan 31, 2022
marcusdacoregio added a commit that referenced this issue Jan 31, 2022
@marcusdacoregio marcusdacoregio added for: backport-to-5.6.x Designates an issue for backport to 5.6.x status: backported An issue that has been backported to maintenance branches and removed for: backport-to-5.6.x Designates an issue for backport to 5.6.x labels Jan 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web An issue in web modules (web, webmvc) status: backported An issue that has been backported to maintenance branches type: bug A general bug
Projects
None yet
Development

No branches or pull requests

3 participants