Skip to content

Commit edc4842

Browse files
slandellenormanmaurer
authored andcommitted
Fix cookie date parsing, close #6016
Motivation: * RFC6265 defines its own parser which is different from RFC1123 (it accepts RFC1123 format but also other ones). Basically, it's very lax on delimiters, ignores day of week and timezone. Currently, ClientCookieDecoder uses HttpHeaderDateFormat underneath, and can't parse valid cookies such as Github ones whose expires attribute looks like "Sun, 27 Nov 2016 19:37:15 -0000" * ServerSideCookieEncoder currently uses HttpHeaderDateFormat underneath for formatting expires field, and it's slow. Modifications: * Introduce HttpHeaderDateFormatter that correctly implement RFC6265 * Use HttpHeaderDateFormatter in ClientCookieDecoder and ServerCookieEncoder * Deprecate HttpHeaderDateFormat Result: * Proper RFC6265 dates support * Faster ServerCookieEncoder and ClientCookieDecoder * Faster tool for handling headers such as "Expires" and "Date"
1 parent 0bc30a1 commit edc4842

8 files changed

Lines changed: 663 additions & 26 deletions

File tree

‎codec-http/src/main/java/io/netty/handler/codec/http/HttpHeaderDateFormat.java‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@
3232
* <li>Sunday, 06-Nov-94 08:49:37 GMT: obsolete specification</li>
3333
* <li>Sun Nov 6 08:49:37 1994: obsolete specification</li>
3434
* </ul>
35+
* @deprecated Use {@link HttpHeaderDateFormatter} instead
3536
*/
37+
@Deprecated
3638
public final class HttpHeaderDateFormat extends SimpleDateFormat {
3739
private static final long serialVersionUID = -925286159755905325L;
3840

0 commit comments

Comments
 (0)