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

Closed
spring-issuemaster opened this issue Feb 8, 2017 · 0 comments

Comments

@spring-issuemaster
Copy link
Collaborator

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
Projects
None yet
2 participants
You can’t perform that action at this time.