[ 
https://issues.apache.org/jira/browse/CAMEL-9105?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Sergey Beryozkin updated CAMEL-9105:
------------------------------------
    Attachment: camel9105.txt

The patch:
- updates DefaultHttpBinding to convert Date and Locale instances locally by 
default
- if "http.binding.date.locale.conversion" is explicitly set to false then it 
delegates to TypeConverters as before.
- test added
- should work with CXF and non-CXF HTTP consumers depending on a Camel transport

The only possible sensitive issue is whether the local conversion should be 
enabled by default (as in the patch) or disabled by default.

I think reporting a Date value as Date.toString() in HTTP header is basically a 
bug given that HTTP dates have a different format compared to the one used by 
Date.toString(). It is also a bug for Locale (see a link in the patch to the 
relevant HTTP spec section)
If the users do want for some reasons use pure String representations for Date 
and Locale then they can definitely set headers as needed before they reach 
DefaultHttpBinding or indeed  enable it to delegate to TypeConverters as before.

So two options:
1. the local conversion should be enabled by default on the trunk given that in 
most cases it will be the right thing to do at the HTTP Binding level but 
disable the conversion by default on branches. Make Camel 2.16 migration note 
that  the local conversion will enabled by default.
2. Keep it disabled by default as before and let users directly enable it.

IMHO option 1 is better - less work for the majority of users. 

 

> Camel DefaultHttpBinding should convert response Date headers to 
> HTTP-friendly format
> -------------------------------------------------------------------------------------
>
>                 Key: CAMEL-9105
>                 URL: https://issues.apache.org/jira/browse/CAMEL-9105
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-http-common
>            Reporter: Sergey Beryozkin
>            Priority: Minor
>             Fix For: 2.16.0
>
>         Attachments: camel9105.txt
>
>
> This is related to CAMEL-9091 except that the optional transformation of Date 
> and also Locale instances can be of use to all of Camel HTTP consumers 
> depending on a Camel transport. It is also likely a cleaner solution because 
> at the CXF component level the headers may be going out to JMS/etc flows
> Note the use of type converters will still be possible, however installing a 
> global type converter converting Date to HTTP-friendly rep is deemed 
> sensitive. 



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

Reply via email to