mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-09-17 08:24:13 +00:00
Enforce "data: " prefix for outgoing SSE data payloads
Prior to this commit, SSE support in Spring would write payloads with the "data:" prefix (without space). While this is OK with the standard, this makes it harder for implementations to support reading and writing payloads with Spring (the round trip use case). This commit introduces a breaking change and now enforces "data: " in all variants. This has the potential of breaking some low level test suites with text/plain or custom media types, but this should overall make the situation better for developers. Closes gh-37242
This commit is contained in:
+1
-1
@@ -52,7 +52,7 @@ class ReactiveReturnTypeTests {
|
||||
.andReturn();
|
||||
|
||||
mockMvc.perform(asyncDispatch(mvcResult))
|
||||
.andExpect(content().string("data:event0\n\ndata:event1\n\ndata:event2\n\n"));
|
||||
.andExpect(content().string("data: event0\n\ndata: event1\n\ndata: event2\n\n"));
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user