Restore 2 digit days format in HttpHeaders

As recommended by RFC 7231, this commit restore using 2 digit days
when formatting dates while still using
DateTimeFormatter.RFC_1123_DATE_TIME for parsing.

Closes gh-22611
This commit is contained in:
Sebastien Deleuze
2019-03-21 17:39:08 +01:00
parent 24e277d791
commit fb33e8451a
6 changed files with 32 additions and 33 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -169,7 +169,7 @@ public class MockHttpServletResponseTests {
response.addCookie(cookie);
assertEquals("foo=bar; Path=/path; Domain=example.com; " +
"Max-Age=0; Expires=Thu, 1 Jan 1970 00:00:00 GMT; " +
"Max-Age=0; Expires=Thu, 01 Jan 1970 00:00:00 GMT; " +
"Secure; HttpOnly", response.getHeader(HttpHeaders.SET_COOKIE));
}