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

EncoderHttpMessageWriter never sets Content-Length [SPR-16542] #21085

Closed
spring-projects-issues opened this issue Feb 27, 2018 · 0 comments
Closed
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Feb 27, 2018

Rossen Stoyanchev opened SPR-16542 and commented

Currently only ResourceHttpMessageWriter and FormHttpMessageWriter set the Content-Length header. For any Encoder (String, byte[], ByteBuffer, etc) wrapped with EncoderHttpMessageWriter, 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's syncBody, 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 HttpMessageConverters, covering all single value cases (synchronous or asynchronous).


Affects: 5.0.4

Issue Links:

Referenced from: commits 2781584

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants