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

Should call getNativeResponse() instead of getNativeRequest() in FrameworkServlet [SPR-15867] #20422

spring-projects-issues opened this issue Aug 16, 2017 · 1 comment
in: web type: bug


Copy link

spring-projects-issues commented Aug 16, 2017

Etienne Neveu opened SPR-15867 and commented

While reading the code of FrameworkServlet#RequestBindingInterceptor, I noticed that we try to obtain the HttpServletResponse using webRequest.getNativeRequest(HttpServletResponse.class) instead of webRequest.getNativeResponse(HttpServletResponse.class) :

I'm wondering if it's a typo, and if it should be fixed?

I'm not sure about the impact, but it seems to have been added in this commit, so I guess it is not a huge issue, since the code is here since 2013... But I thought I might as well create a ticket, just in case.

Affects: 4.3.10, 5.0 RC3

Issue Links:

Referenced from: commits 9dcdfec, b8f5e97

Copy link
Collaborator Author

spring-projects-issues commented Aug 16, 2017

Juergen Hoeller commented

Good catch! Indeed, that's accidental. We do not rely on the HttpServletResponse being present in the RequestAttributes for standard purposes, which is why we haven't noticed this... but the whole point of course is to make it available for custom use even in async request callbacks, so this needs to be fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
in: web type: bug
None yet

No branches or pull requests

2 participants