-
Notifications
You must be signed in to change notification settings - Fork 38.5k
Content-Length should be set in the request when using reactive WebClient [SPR-16949] #19562
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
Comments
Brian Clozel commented Hi Mirko Adebahr, As of #21431, we've got integration tests covering this use case (see the changes attached to the commit fixing that issue). Could you provide us with a small application that reproduces this issue? Thanks, |
Mirko Adebahr commented Hi Brian, please correct me if I'm wrong, but if you're referring to I understand that an application for reproduction of this issue would be helpful, but we're talking about a client/server scenario. Maybe it would be sufficient if someone familiar with webflux could take a look and confirm the problem? |
Brian Clozel commented This is now fixed in 5.0.x and master (5.1.x) - new SNAPSHOT builds should be available shortly if you'd like to test it against your project before the next releases. Thanks! |
Juergen Hoeller commented Mirko Adebahr, please give this a try against a recent snapshot: ideally |
Mirko Adebahr commented OK, I'll try to test it until Wednesday. |
Mirko Adebahr commented It's working, we're looking forward for the next release. Thanks! |
Brian Clozel commented Thanks a lot for checking Mirko Adebahr, this is helping a lot. |
Mirko Adebahr opened SPR-16949 and commented
As of #21431, the
content-length
header should be set in the request forMono
publishers when using the reactiveWebClient
. Still, as far as I can see the header is not set in the HTTP request.This is what I think is the problem:
AbstractClientHttpRequest::doCommit
:applyHeaders()
is called as commit action -> Headers are applied tohttpRequest
inReactorClientHttpRequest
body.doOnNext(data -> headers.setContentLength(data.readableByteCount()))
is called (seeEncoderHttpMessageWriter::write
)The
doOnNext
seems to be executed too late to have an effect on the headers in the HTTP request.Affects: 5.0.7
Issue Links:
Referenced from: commits 280da61, 6189e17, 4a26f93, d1c9401
The text was updated successfully, but these errors were encountered: