users@jersey.java.net

[Jersey] Re: Jersey bug for Date headers

From: Pavel Bucek <pavel.bucek_at_oracle.com>
Date: Mon, 12 Dec 2011 11:02:28 +0100

On 12/9/11 12:13 AM, Gili wrote:
> Gili wrote
>> Hi,
>>
>> Following up on
>> http://jersey.576304.n2.nabble.com/Re-Bug-in-Jersey-s-header-parser-td581274.html
>> I believe it is a bug for Jersey to only try RFC1123 for parsing dates.
>> According to the specification you must try *three* different date formats
>> before giving up:
>>
>> http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3
>>
>> According to
>> http://eclipsesrc.appspot.com/jsrcs/org.eclipse.higgins/plugins/org.eclipse.ecf.provider.rss/src/org/eclipse/ecf/provider/rss/http/HttpMessage.java.html
>> the three relevant SimpleDateFormats are:
>>
>> EEE, dd MMM yyyy HH:mm:ss zzz // rfc 1123
>> EEEE, dd-MMM-yy HH:mm:ss zzz // rfc 850
>> EEE MMM dd HH:mm:ss yyyy // asctime format
>>
>> but of course you should verify whether this is true. Should I open a bug
>> report for this?
>>
>> Gili
>>
> Nevermind. It looks like you're doing the right thing in
> com.sun.jersey.core.header.HttpDateFormat. Can I assume that this issue is
> fixed?
yes, you can.

See
http://java.net/projects/jersey/sources/svn/content/trunk/jersey/jersey-tests/src/test/java/com/sun/jersey/impl/http/header/HttpHeaderTest.java?rev=5569
; method testDateParsing.

Regards,
Pavel

>
> Thanks,
> Gili
>
> --
> View this message in context: http://jersey.576304.n2.nabble.com/Jersey-bug-for-Date-headers-tp7076273p7076294.html
> Sent from the Jersey mailing list archive at Nabble.com.
>