Prior to this commit the implementation of isSecure() in
MockHttpServletRequest simply returned the value of the 'secure'
boolean flag. Thus setting the scheme to 'https' had no effect on the
value returned by isSecure() even though most non-mock implementations
(e.g., Tomcat, Jetty, etc.) base the return value on the actual scheme
in the request.
This commit makes the behavior of MockHttpServletRequest.isSecure()
more intuitive by honoring both the 'secure' boolean flag and the
current value of the scheme.
Eujung Kim opened SPR-12098 and commented
javadoc for ServletRequest.isSecure() is as follow.
But isSecure() in MockHttpServletRequest returns only this.secure set by setSecure(boolean) method.
And the method does not refer value of scheme(http or https ...)
I think isSecure() should return "true" if scheme is "https".
Affects: 4.0 GA
Referenced from: commits 0b0ddc6
1 votes, 3 watchers
The text was updated successfully, but these errors were encountered: