Skip to content

ServerSentEventHttpMessageReader does not respect maxInMemorySize and is always limited to 256k messages #24312

Closed
@jacqueslemire

Description

@jacqueslemire

Affects: 5.2.2, 5.2.1


To reproduce:

  • Create a ServerSentEventHttpMessageReader with a decoder that has maxInMemorySize > 256k.
  • Call either read or readMono with 256k < len(message body) <= maxInMemorySize
  • DataBufferLimitException is thrown

Expected:

  • The configured buffer limit is applied and not error is thrown

The problem is that while the data decoder passed to ServerSentEventHttpMessageReader is properly configured to support a larger maxInMemorySize, that decoder is only used to decode the data part of the message. Prior to that, the SSE's body is decoded through a different decoder (private static final StringDecoder stringDecoder = StringDecoder.textPlainOnly()) which is not properly configured - nore is it accessible in any way - with the new limit.

Note that to my understanding, prior to 5.2.0 there was no limit at all imposed to the body. Now there is one (see 89d053d by @rstoyanchev) , but we have no way to adjust it.

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: regressionA bug that is also a regression

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions