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.
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.
spring-projects-issues commentedAug 16, 2017
•
edited
Etienne Neveu opened SPR-15867 and commented
While reading the code of
FrameworkServlet#RequestBindingInterceptor
, I noticed that we try to obtain theHttpServletResponse
usingwebRequest.getNativeRequest(HttpServletResponse.class)
instead ofwebRequest.getNativeResponse(HttpServletResponse.class)
:https://github.com/spring-projects/spring-framework/blob/v5.0.0.RC3/spring-webmvc/src/main/java/org/springframework/web/servlet/FrameworkServlet.java#L1142
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
The text was updated successfully, but these errors were encountered: