Skip to content

AbstractJackson2Encoder::getContentLength should not return null for MonoJust/FluxJust publisher [SPR-16892] #21431

Closed
@spring-projects-issues

Description

@spring-projects-issues

Mirko Adebahr opened SPR-16892 and commented

We're trying to use WebClient for creating a non-blocking POST request. The request results in a 400 Bad Request due to a missing content-length header. As the requested endpoint belongs to a 3rd party application, we cannot change that server's behaviour.

In #21085, the EncoderHttpMessageWriter was enhanced to automatically set the content-length Header if the provided publisher is a Mono. Unfortunately, this does not help when using Jackson2JsonEncoder for encoding as getContentLength will always return null.

In my understanding, for MonoJusts and FluxJusts it should be possible to determine the content length and set the header value accordingly.


Affects: 5.0.6

Issue Links:

Referenced from: commits 0103521, 4a26f93, 7bfd683, d1c9401

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions