You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (Jira)" <ji...@apache.org> on 2022/10/07 03:37:00 UTC

[jira] [Updated] (CAMEL-18589) Bug in org.apache.camel.http.common.DefaultHttpBinding.java

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

Claus Ibsen updated CAMEL-18589:
--------------------------------
    Priority: Minor  (was: Major)

> Bug in org.apache.camel.http.common.DefaultHttpBinding.java
> -----------------------------------------------------------
>
>                 Key: CAMEL-18589
>                 URL: https://issues.apache.org/jira/browse/CAMEL-18589
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-http-common
>            Reporter: Praveen Prabhu
>            Priority: Minor
>
> The readHeaders() method in DefaultHttpBinding class has a bug. The loop "while (names.hasMoreElements()" iterates over all the header names in a http request, and the statement "String value = request.getHeader(name);" ends up reading only one header of the given name. Underlying http request object created by implementations like jetty use Set<String> internally to return unique names for the request.getHeaderNames(), hence if there are multiple headers with same name (e.g. Cookie), then this ends up in creating only a single entry in the exchange headers. I think this can be fixed by calling getHeaders(name) method on the request object rather than the getHeader(name) and then enumerate over the returned values and set a list of headers of the same name.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)