EncoderHttpMessageWriter never sets Content-Length [SPR-16542] #21085
Labels
in: web
Issues in web modules (web, webmvc, webflux, websocket)
type: enhancement
A general enhancement
Milestone
Rossen Stoyanchev opened SPR-16542 and commented
Currently only
ResourceHttpMessageWriter
andFormHttpMessageWriter
set the Content-Length header. For anyEncoder
(String, byte[], ByteBuffer, etc) wrapped withEncoderHttpMessageWriter
, there is no mechanism in place to set the Content-Length header, even in cases where a single item is provided synchronously (e.g. WebClient'ssyncBody
, controller returning a String, etc.).We should be able to set the content length in cases where the input Publisher is a Mono. That would provide parity with
HttpMessageConverter
s, covering all single value cases (synchronous or asynchronous).Affects: 5.0.4
Issue Links:
Referenced from: commits 2781584
The text was updated successfully, but these errors were encountered: