Closed
Description
Mirko Adebahr opened SPR-16949 and commented
As of #21431, the content-length
header should be set in the request for Mono
publishers when using the reactive WebClient
. 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
- After this,
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:
- AbstractJackson2Encoder::getContentLength should not return null for MonoJust/FluxJust publisher [SPR-16892] #21431 AbstractJackson2Encoder::getContentLength should not return null for MonoJust/FluxJust publisher