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

MockHttpServletRequest.protocol default should be "HTTP/1.1", not "http" [SPR-15232] #19797

spring-projects-issues opened this issue Feb 8, 2017 · 0 comments


Copy link

@spring-projects-issues spring-projects-issues commented Feb 8, 2017

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:

  • #19780 MockHttpServletRequest.getReader() returns null in case of no content
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants