Community
Participate
Working Groups
Build Identifier: Jetty 7.3.0 on line 1077 of HttpFields.java, addSetCookie adds an Expires HTTP header: 1076 // Expire responses with set-cookie headers so they do not get cached. 1077 put(HttpHeaders.EXPIRES_BUFFER, __01Jan1970_BUFFER); The field __01Jan1970_BUFFER actually refers to the cookie date formatter, rather than the http date formatter, so the Expires header comes out wrong in the response: Expires: Thu, 01-Jan-1970 00:00:00 GMT Note the dashes. Unfortunately __01Jan1970_BUFFER is a public field, but as far as I can tell only addSetCookie refers to it. Changing this line: 284 public final static String __01Jan1970=formatCookieDate(0); to 284 public final static String __01Jan1970=formatDate(0); would fix it. Reproducible: Always
Do not apply the patch proposed above since that would cause bug #338364 to return. Both formats of 1 Jan 1970 are required since they are used in two different cases, the HTTP Expires header and the Expire part of Netscape style cookies. The two uses should have different formats, changing the definition of __01Jan1970 back and forth is not the solution. See my original patch of bug #338364 for a working alternative.
This is bug #338364? I think you must mean #304698 or #304658
Fixed in jetty-7 r3162 and jetty-6 r6570 by reverting to the patch proposed in 304658. But also found an issue where the expires header was not being set if other cancelled fields existed. Also fixed. thanks
as above
Sorry about the mixup of bug numbers. Bug #338364 should be replaced by bug #304658 in my previous comment. But I can see you figured out that yourself. Thank you.