Closed alexm76x closed 1 year ago
That commit has not changed any of the characters materially, just using char instead of String values for them. I'm wondering why that could have caused an actual difference in the output...
As for the SSE spec, I'm reading it as alternatives: either CR LF or just CR or just LF. Could you please double-check what kind of effect you are seeing there, and whether it actually is a regression from earlier Spring Framework versions?
I'm terribly sorry, this is false alarm. The problem turned out to be with my JS client code.
The following commit https://github.com/spring-projects/spring-framework/commit/a2ef6badc4c76790128910851fdde0df55ec15f9 causes SseEmitter to use \n as newline character on Linux systems. However, for SSE the HTML standard clearly requires newline characters to be \r\n https://html.spec.whatwg.org/multipage/server-sent-events.html#parsing-an-event-stream This causes the browser SSE client to stop raising "onmessage" event in EventSource when used with Spring MVC server. Tested on Edge and Firefox.