Closed
Description
Adam Michalik opened SPR-15232 and commented
ServletRequest.getProtocol()
JavaDoc says
Returns the name and version of the protocol the request uses in the form protocol/majorVersion.minorVersion, for example, HTTP/1.1.
However, MockHttpServletRequest.protocol
defaults to "http"
which violates the contract of the JavaDoc.
There is no way to override this default when using MockMvc
and MockHttpServletRequestBuilder
, so the default MockHttpServletRequest.protocol
should rather be "HTTP/1.1"
so that it better resembles a real-life HTTP request.
Affects: 4.3.6
Issue Links:
- MockHttpServletRequest.getReader() returns null in case of no content [SPR-15215] #19780 MockHttpServletRequest.getReader() returns null in case of no content