Skip to content

sse breaks with indenting serializer [SPR-14899] #19465

Closed
@spring-projects-issues

Description

@spring-projects-issues

Jorg Heymans opened SPR-14899 and commented

in application.properties i have
spring.jackson.serialization.indent_output=true

i then send a normal pojo object:

emitter.send(SseEmitter.event().data(pojo));

The jackson serializer config indents the output, and the result is sent as one dataline which is invalid:

data:{
  "userId" : "myuser",
  "objectId" : "s1"
}

in fact this should be

data: {\n
data: "userId" : "myuser",\n
data: "objectId" : "s1"\n
data: }\n\n

when i remove the indentation on the jackson serializer it's correct:

data: { "userId" : "myuser", "objectId" : "s1" }

Affects: 4.3.3

Issue Links:

Referenced from: commits 5700d65, 2735cba

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions