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

ASF subversion and git services commented on HTTPCLIENT-2361:
-------------------------------------------------------------

Commit b7ece752eb52450c6190ae002ae84293ac56b5a9 in httpcomponents-client's 
branch refs/heads/HTTPCLIENT-2361 from Oleg Kalnichevski
[ https://gitbox.apache.org/repos/asf?p=httpcomponents-client.git;h=b7ece752e ]

HTTPCLIENT-2361: Tolerate multiple `Cookie` headers added by the caller


> Use of multiple "Cookie" headers leads to exception
> ---------------------------------------------------
>
>                 Key: HTTPCLIENT-2361
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-2361
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>    Affects Versions: 5.4.2
>            Reporter: shpelda
>            Priority: Trivial
>             Fix For: 5.4.3, 5.5-alpha1
>
>
> Using multiple Cookie headers leads to exception. In my case  they were set 
> by apache-cxf:4.0.1, using  
> _WebClient.getConfig(cxfClientProxy).getHttpConduit().getCookies().put()_
>  
> {code:java}
> Caused by: org.apache.hc.core5.http.ProtocolException: multiple 'Cookie' 
> headers found
>     at 
> org.apache.hc.core5.http.message.HeaderGroup.getHeader(HeaderGroup.java:267)
>     at 
> org.apache.hc.client5.http.protocol.RequestAddCookies.process(RequestAddCookies.java:94)
>     at 
> org.apache.hc.core5.http.protocol.DefaultHttpProcessor.process(DefaultHttpProcessor.java:107)
>     at 
> org.apache.hc.client5.http.impl.async.HttpAsyncMainClientExec$1.produceRequest(HttpAsyncMainClientExec.java:153)
>     at 
> org.apache.hc.core5.http.impl.nio.ClientHttp1StreamHandler.produceOutput(ClientHttp1StreamHandler.java:186)
>     at 
> org.apache.hc.core5.http.impl.nio.ClientHttp1StreamDuplexer.execute(ClientHttp1StreamDuplexer.java:326)
>     at 
> org.apache.hc.core5.http.impl.nio.AbstractHttp1StreamDuplexer.processCommands(AbstractHttp1StreamDuplexer.java:242)
>     at 
> org.apache.hc.core5.http.impl.nio.AbstractHttp1StreamDuplexer.onOutput(AbstractHttp1StreamDuplexer.java:389)
>     at 
> org.apache.hc.core5.http.impl.nio.AbstractHttp1IOEventHandler.outputReady(AbstractHttp1IOEventHandler.java:73)
>     at 
> org.apache.hc.core5.http.impl.nio.ClientHttp1IOEventHandler.outputReady(ClientHttp1IOEventHandler.java:41)
>     at 
> org.apache.hc.core5.reactor.InternalDataChannel.onIOEvent(InternalDataChannel.java:153)
>     at 
> org.apache.hc.core5.reactor.InternalChannel.handleIOEvent(InternalChannel.java:51)
>     at 
> org.apache.hc.core5.reactor.SingleCoreIOReactor.processEvents(SingleCoreIOReactor.java:176)
>     at 
> org.apache.hc.core5.reactor.SingleCoreIOReactor.doExecute(SingleCoreIOReactor.java:125)
>     at 
> org.apache.hc.core5.reactor.AbstractSingleCoreIOReactor.execute(AbstractSingleCoreIOReactor.java:92)
>     at 
> org.apache.hc.core5.reactor.IOReactorWorker.run(IOReactorWorker.java:44)
>     at java.base/java.lang.Thread.run(Thread.java:833) {code}
> I think that this code should use _getHeaders(name)_ instead:
> [https://hc.apache.org/httpcomponents-client-5.4.x/5.4.1/httpclient5/xref/org/apache/hc/client5/http/protocol/RequestAddCookies.html#L94]



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

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org

Reply via email to