You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Stephan Siano (JIRA)" <ji...@apache.org> on 2017/08/10 14:18:00 UTC

[jira] [Commented] (CAMEL-11662) camel-ahc does not support multi-value HTTP headers properly

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

Stephan Siano commented on CAMEL-11662:
---------------------------------------

On a second thought the current behaviour is implemented across all HTTP components in Camel. Having multiple HTTP headers with one name is forbidden by RFC 7230 (except for well known exceptions like the Set-Cookie header). 

The RFC also states that "a recipient MAY combine multiple header fields with the same field name into one "field-name: field-value" pair, without changing the semantics of the message, by appending each subsequent field value to the combined field value in order, separated by a comma.

From that perspective it might be an idea to use the list semantic without the sqare brackets in camel, but that would break compatibility, so we'd probably leave everything as it is.

> camel-ahc does not support multi-value HTTP headers properly
> ------------------------------------------------------------
>
>                 Key: CAMEL-11662
>                 URL: https://issues.apache.org/jira/browse/CAMEL-11662
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-ahc
>    Affects Versions: 2.19.1
>            Reporter: Stephan Siano
>            Assignee: Stephan Siano
>            Priority: Minor
>             Fix For: 2.20.0
>
>
> The camel-ahc component does not support multi-value HTTP headers properly.
> If the camel message contains a header with a list value the list is converted into a String before setting it to a header, which is not the proper format for a multi-value http header.
> Example: If the camel header named "to" has a value of type List<String>, which contains the elements "foo" and "bar" the generated HTTP header named "to" will have the value "[foo, bar]"
> According to RFC 7230 section 3.2.2 this is the wrong format. There should be a single line generated from it, but the list should simply be comma separated ("foo, bar" without the square brackets).



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)