cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "metatech (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CXF-6528) JAX-RS "lastModified" generates timestamp with non-standard format
Date Thu, 13 Aug 2015 07:44:45 GMT

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

metatech commented on CXF-6528:
-------------------------------

I had a quick look at the ContainerResponseFilter, but it is not trivial to register it in
a generic way in CXF.
BTW, I think the same problem also impacts the "Expires" (it is also a Date).

Another solution which would be simpler : add a HttpDate nested class in ResponseBuilderImpl,
which overrides the "toString()" method to format it in the standard HTTP format.  When the
application calls the "lastModified" or "expires" method, the ResponseBuilderImpl "clones"
the Date into an HttpDate.
This way, the Technology Compatibility Kit tests will access a (Http)Date object from the
"Last-Modified" or "Expires" headers (and not a String).
What is your opinion ?

> JAX-RS "lastModified" generates timestamp with non-standard format
> ------------------------------------------------------------------
>
>                 Key: CXF-6528
>                 URL: https://issues.apache.org/jira/browse/CXF-6528
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 3.0.0-milestone2
>         Environment: ServiceMix 5.4.0
>            Reporter: metatech
>
> In CXF 3.x (since CXF-5007), the date format has changed in the "Last-Modified" HTTP
header generated by JAX-RS.
> In class org.apache.cxf.jaxrs.impl.ResponseBuilderImpl, the method "lastModified()" does
not call the "toHttpDate" anymore.
> The format is now the default format used when calling "toString" on the date object.
> This format is not one of the 3 allowed by the HTTP specification (RFC2616, section 3.3.1).
> For instance, an HTTPClient will reject this date format :  
> ====================
> Wrong date format for date Wed Aug 12 08:18:54 CEST 2015
> org.apache.commons.httpclient.util.DateParseException: Unable to parse the date Wed Aug
12 08:18:54 CEST 2015
>         at org.apache.commons.httpclient.util.DateUtil.parseDate(DateUtil.java:170)
>         at org.apache.commons.httpclient.util.DateUtil.parseDate(DateUtil.java:94)
> ====================
> Can you please restore the date conversion ?
> Thanks in advance.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message