[ https://issues.apache.org/jira/browse/CXF-8214?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17038394#comment-17038394 ]
Ivan Topić commented on CXF-8214: --------------------------------- I've created an Idea Maven project that simulates our problem. [^Test-Content-Length.zip] > 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: 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)