Skip to content

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

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

Closed
spring-projects-issues opened this issue Nov 11, 2016 · 2 comments
Closed

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

spring-projects-issues opened this issue Nov 11, 2016 · 2 comments
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: bug A general bug
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Nov 11, 2016

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

@spring-projects-issues
Copy link
Collaborator Author

Sébastien Deleuze commented

Pull request submitted.

@spring-projects-issues
Copy link
Collaborator Author

Sébastien Deleuze commented

Fixed on master and 4.3.x branches.

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: bug A general bug
Projects
None yet
Development

No branches or pull requests

2 participants