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

MockHttpServletResponse.getDateHeader fails with NPE for non-existing header [SPR-16160] #20708

Closed
spring-projects-issues opened this issue Nov 5, 2017 · 1 comment
Assignees
Labels
in: test Issues in the test module status: backported An issue that has been backported to maintenance branches type: bug A general bug
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Nov 5, 2017

Juergen Hoeller opened SPR-16160 and commented

MockHttpServletResponse.getDateHeader doesn't check for the existence of the corresponding header and ends up calling DateFormat.parse with a null value. Aligned with HttpServletRequest.getDateHeader(), it should simply return -1 in such a case.


Affects: 4.3.12, 5.0.1

Issue Links:

Referenced from: commits a75dd2d, 80a0cf7, dc0a934

Backported to: 4.3.13

@spring-projects-issues
Copy link
Collaborator Author

Juergen Hoeller commented

As far as possible, we're also using MockHttpServletResponse.getDateHeader within our own tests now instead of trying to match the concrete date presentation in the textual header value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: test Issues in the test module status: backported An issue that has been backported to maintenance branches type: bug A general bug
Projects
None yet
Development

No branches or pull requests

2 participants