[
https://issues.apache.org/jira/browse/CXF-8914?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17757889#comment-17757889
]
Stephan Näcker commented on CXF-8914:
-------------------------------------
Hi [~reta],
my application is a Spring Boot one on version 2.7.13. The REST calls are done
via the {{{}org.apache.cxf.jaxrs.client.WebClient{}}}.
In the first step we create a template instance:
{code:java}
JAXRSClientFactoryBean factory = new JAXRSClientFactoryBean();
configureBaseUrl(factory);
configureLogging(factory);
configureCredentials(factory);
configureClientFactory(factory);
template = factory.createWebClient();
{code}
I think, you can ignore those calls to configureWhatever.
Then - for a specific endpoint - we create the web client to be used based on
this template, like:
{code:java}
WebClient client = WebClient.fromClient(template, true);{code}
And before sending the request, we don't allow chunking:
{code:java}
client.getConfiguration().getHttpConduit().getClient().setAllowChunking(false);{code}
That's how we setup the web client.
But one more thing: For now this is not a critical issue for us. We just
decided to keep on using version 3.5.6. If this issue is an error, that will be
solved in a future version, then I would probably prefer waiting for the fix
instead of adding a workaround, that I may need to remove again later on.
But if this was an intended change, I would be happy for your help, or course.
> No content-length header after upgrade CXF from 3.5.6 to 3.6.1
> --------------------------------------------------------------
>
> Key: CXF-8914
> URL: https://issues.apache.org/jira/browse/CXF-8914
> Project: CXF
> Issue Type: Bug
> Affects Versions: 3.6.1
> Environment: SpringBoot 2.7.13
> Reporter: Stephan Näcker
> Priority: Major
>
> After updating the CXF dependency in our application from 3.5.6 to 3.6.1 it
> does not add a content-length header anymore, when doing a multipart request
> for a file upload.
> I didn't find any information, how to let CXF set the header. Is it just
> dependent of chunking?
> Actually the application sets "allow chunking" to false. But I'm not sure,
> how I can test, if this really works.
> Thanks in advance for your help.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)