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 does not handle rfc formatted dates. [SPR-12056] #16672

Closed
spring-projects-issues opened this issue Aug 1, 2014 · 3 comments
Labels
in: test status: duplicate type: enhancement

Comments

@spring-projects-issues
Copy link
Collaborator

@spring-projects-issues spring-projects-issues commented Aug 1, 2014

Jakub Narloch opened SPR-12056 and commented

We have plug our REST client to work with the Spring MVC Test framework and we have noticied that sending the "IF-MODIFIED-SINCE" header breaks the server side code. The MockHttpServletRequest#getDateHeader should be blamed for that.

Apparently the implementation assumes that the date would be passed in memory as a java.lang.Date or optionally as numeric representation. Unfortnunetlly that is not the case when you try to test the code with production-ready client.

I think that the implementation should be consistent as much possible with the expected behaviour so I propose to add additional support for the valid date format representations as described in: http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1


Issue Links:

  • #16531 MockHttpServletResponse.setDateHeader does not perform date formatting ("duplicates")

Referenced from: pull request #614

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Aug 1, 2014

Jakub Narloch commented

I've got this idea to revwirte the MockHttpServletRequest and MockHttpServletResponse in a way that it would use the org.springframework.http.HttpHeaders.

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Aug 1, 2014

Jakub Narloch commented

I've made the pull request: #614

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Aug 2, 2014

Sam Brannen commented

This is a duplicate of #16531.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: test status: duplicate type: enhancement
Projects
None yet
Development

No branches or pull requests

1 participant