You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Andriy Redko (Jira)" <ji...@apache.org> on 2021/04/04 14:05:00 UTC
[jira] [Commented] (CXF-8447) Content-Language always set to en_US
[ https://issues.apache.org/jira/browse/CXF-8447?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17314504#comment-17314504 ]
Andriy Redko commented on CXF-8447:
-----------------------------------
[~jgreffe] I think CXF does the right thing here:
- the {{WebClient}}::{{language()}} serves as the default value (if provided)
- the {{Entity}}::{{getLanguage()}} is explicitly specified on entity level and takes the precedence
As you pointed out, the issue is in
[https://github.com/apache/camel/blob/master/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/DefaultCxfRsBinding.java#L255]
so it should be enhanced to use the language from the Message, something along these lines
{noformat}
String contentLanguage = camelMessage.getHeader(Exchange.CONTENT_LANGUAGE, String.class); {noformat}
and than pass it through to {{Entity}}::{{entity()}}
> Content-Language always set to en_US
> ------------------------------------
>
> Key: CXF-8447
> URL: https://issues.apache.org/jira/browse/CXF-8447
> Project: CXF
> Issue Type: Bug
> Components: JAX-RS
> Affects Versions: 3.3.1, 3.4.3
> Reporter: Julien Greffe
> Priority: Minor
>
> Hello,
> it seems there's an issue with header {{Content-Language}} which is always set to {{en_US}}.
> Here, entity is created with this default value:
> [https://github.com/apache/camel/blob/master/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/DefaultCxfRsBinding.java#L255]
> And even when using {{language()}} on {{WebClient}}, value is always overriden here:
> [https://github.com/apache/cxf/blob/master/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/WebClient.java#L1329]
>
> Could you please provide a fix?
--
This message was sent by Atlassian Jira
(v8.3.4#803005)