hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Darren Hague (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HTTPCLIENT-1530) DateUtils.parseDate not fully compliant with RFC 1123
Date Thu, 17 Jul 2014 14:41:04 GMT

    [ https://issues.apache.org/jira/browse/HTTPCLIENT-1530?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14064969#comment-14064969
] 

Darren Hague commented on HTTPCLIENT-1530:
------------------------------------------

The fix for this issue is to add PATTERN_RFC1123_NUMERIC_OFFSET as follows:
{code}
    /**
     * Date format pattern used to parse HTTP date headers in RFC 1123 format.
     */
    public static final String PATTERN_RFC1123 = "EEE, dd MMM yyyy HH:mm:ss zzz";
    public static final String PATTERN_RFC1123_NUMERIC_OFFSET = "EEE, dd MMM yyyy HH:mm:ss
Z";

    /**
     * Date format pattern used to parse HTTP date headers in RFC 1036 format.
     */
    public static final String PATTERN_RFC1036 = "EEE, dd-MMM-yy HH:mm:ss zzz";

    /**
     * Date format pattern used to parse HTTP date headers in ANSI C
     * <code>asctime()</code> format.
     */
    public static final String PATTERN_ASCTIME = "EEE MMM d HH:mm:ss yyyy";

    private static final String[] DEFAULT_PATTERNS = new String[] {
        PATTERN_RFC1123,
        PATTERN_RFC1123_NUMERIC_OFFSET ,
        PATTERN_RFC1036,
        PATTERN_ASCTIME
    };
{code}

> DateUtils.parseDate not fully compliant with RFC 1123
> -----------------------------------------------------
>
>                 Key: HTTPCLIENT-1530
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1530
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: HttpClient
>    Affects Versions: 4.3.4
>            Reporter: Darren Hague
>
> RFC-1123 (http://www.ietf.org/rfc/rfc1123.txt ) says: 
> There is a strong trend towards the use of numeric timezone
>          indicators, and implementations SHOULD use numeric timezones
>          instead of timezone names.  However, all implementations MUST
>          accept either notation.  If timezone names are used, they MUST
>          be exactly as defined in RFC-822.
> Ruby on Rails v4 issues cookies with a numeric timezone in the expiry date.
> DateUtils.parseDate() is used by HtmlUnit to parse the expiry date of cookies.
> This bug means that HtmlUnit does not correctly deal with cookie expiration when talking
to a Ruby on Rails application.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


Mime
View raw message