You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Ivan Topić (Jira)" <ji...@apache.org> on 2020/06/08 07:36:00 UTC

[jira] [Commented] (CXF-8214) CLONE - Content length missing in HTTP header

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

Ivan Topić commented on CXF-8214:
---------------------------------

Has there been any progress regarding this issue?

> CLONE - Content length missing in HTTP header
> ---------------------------------------------
>
>                 Key: CXF-8214
>                 URL: https://issues.apache.org/jira/browse/CXF-8214
>             Project: CXF
>          Issue Type: Bug
>          Components: Transports
>         Environment: Apache Camel
>            Reporter: Ivan Topić
>            Priority: Major
>             Fix For: Invalid
>
>         Attachments: FiddlerRequestScreenShot.PNG, Test-Content-Length-Main.zip, Test-Content-Length.zip
>
>
> We are using *org.apache.cxf.jaxrs.client.WebClient* in our solution where we send a list of custom headers. 
> All but "Content-Length" are included and sent. We also tried to disable *chunking*, but it had no effect.
> Issue exist in *org.apache.cxf:cxf-rt-rs-client* package, both *3.3.4* and *3.3.5* versions. We are using *Java 8* mainly. We also tried with *Java 13* with no success.
>  
> Partial code:
> Map<String, Object> headers;
> ...
> ...
> ...
> Client client = WebClient.client(api);
> if (headers != null)
>     headers.forEach(client::header);
>  
> We've managed to debug this and found out that all the headers are kept in the "*PROTOCOL_HEADERS*" map up until the actual request is made. At that point, "Content-Length" is omitted. 
>  
> On a side note, body is "*null*" for the request. Shouldn't the "Content-Length : 0" be automatically added?



--
This message was sent by Atlassian Jira
(v8.3.4#803005)