Praveen Prabhu created CAMEL-18589:
--------------------------------------

             Summary: 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


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)

Reply via email to