Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebClient - add option to disable chunked transfer [SPR-15914] #20468

Closed
spring-projects-issues opened this issue Aug 30, 2017 · 8 comments
Closed
Assignees
Labels
in: web type: enhancement
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

@spring-projects-issues spring-projects-issues commented Aug 30, 2017

Marek Hawrylczak opened SPR-15914 and commented

Currently all requests except GET and HEAD are using transfer-encoding: chunked. There is no way to disable it, thus is not possible to call a network device that cannot support chunked transfer.


Affects: 5.0 RC3

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Sep 5, 2017

Arjen Poutsma commented

The chunked transfer-encoding headers is coming from Reactor Netty, the underlying HTTP library. There is an open issue to add a global option for disabling it. Once there, the configuration option can easily be used via this ReactorClientHttpConnector constructor.

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Mar 14, 2018

Alex commented

It seems like Reactor Netty has added the feature, but I don't still find the option in ReactorClientHttpConnector constructor now. Is there any plan to support it or am I missing something?

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Mar 14, 2018

Arjen Poutsma commented

Alex It has been added in the 0.8.x branch, while Spring Framework is on 0.7. We will upgrade to 0.8.x as part of the 5.1 cycle.

In the mean time, I've asked for that feature to be back ported to 0.7, see my comment on the linked issue.

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Aug 6, 2018

Simon commented

It would be really nice to be able to use WebClient for communicating with resources that dont support chunked  encoding and to avoid adding additional 3rd party dependencies for just doing that. 

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Aug 6, 2018

Simon commented

It would also be nice to be able to configure it using the WebClient.Builder without the need to use the reactor.netty.http.client.HttpClient

@spring-projects-issues spring-projects-issues added type: enhancement in: web labels Jan 11, 2019
@spring-projects-issues spring-projects-issues added this to the 5.0 RC4 milestone Jan 11, 2019
@Tetradeus
Copy link

@Tetradeus Tetradeus commented Oct 2, 2020

Even when setting the Content-Length header at WebClient Level, this one is not passed to Netty at "configured" state, and Netty keeps chunking.

@vaibsgharge
Copy link

@vaibsgharge vaibsgharge commented Mar 11, 2021

Any update on this issue, please? I'm setting webclient.contentLength() explicitly still the response is getting chunked.

@rstoyanchev
Copy link
Contributor

@rstoyanchev rstoyanchev commented Mar 15, 2021

I don't think there is anything to update. According to the Javadoc of HttpClient:

 * {@code Transfer-Encoding: chunked} will be applied for those HTTP methods for which
 * a request body is expected. {@code Content-Length} provided via request headers
 * will disable {@code Transfer-Encoding: chunked}.

In other words, this is in Reactor Netty and unless WebClient is somehow not passing the header, I don't see how it could be related to it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web type: enhancement
Projects
None yet
Development

No branches or pull requests

5 participants