-
Notifications
You must be signed in to change notification settings - Fork 38.8k
Closed as not planned
Closed as not planned
Copy link
Labels
in: testIssues in the test moduleIssues in the test modulestatus: declinedA suggestion or change that we don't feel we should currently applyA suggestion or change that we don't feel we should currently applytype: enhancementA general enhancementA general enhancement
Description
Dmitry Katsubo opened SPR-16312 and commented
MockHttpServletRequest has this:
private static final String[] DATE_FORMATS = new String[] {
"EEE, dd MMM yyyy HH:mm:ss zzz",
"EEE, dd-MMM-yy HH:mm:ss zzz",
"EEE MMM dd HH:mm:ss yyyy"
};
MockHttpServletResponse has this:
private static final String DATE_FORMAT = "EEE, dd MMM yyyy HH:mm:ss zzz";
private static final TimeZone GMT = TimeZone.getTimeZone("GMT");
HttpHeaders has this:
private static final DateTimeFormatter[] DATE_FORMATTERS = new DateTimeFormatter[] {
DateTimeFormatter.RFC_1123_DATE_TIME,
DateTimeFormatter.ofPattern("EEEE, dd-MMM-yy HH:mm:ss zz", Locale.US),
DateTimeFormatter.ofPattern("EEE MMM dd HH:mm:ss yyyy",Locale.US).withZone(GMT)
};
To optimize above:
HttpHeadersis addedaddDate(String headerName, long date)method.MockHttpServletResponsedelegatessetDateHeader(String name, long value)andaddDateHeader(String name, long value)toHttpHeaders#setDate()/HttpHeaders#addDate()correspondingly.MockHttpServletRequestdelegatesgetDateHeader(String name)toHttpHeaders#getFirstZonedDateTime(String headerName, boolean rejectInvalid).
Affects: 5.0.1
Issue Links:
- MockHttpServletResponse.setDateHeader does not perform date formatting [SPR-11912] #16531 MockHttpServletResponse.setDateHeader does not perform date formatting
1 votes, 3 watchers
Metadata
Metadata
Assignees
Labels
in: testIssues in the test moduleIssues in the test modulestatus: declinedA suggestion or change that we don't feel we should currently applyA suggestion or change that we don't feel we should currently applytype: enhancementA general enhancementA general enhancement