ElysiaGET /feed?msg=… · Bunelysia 1.4.30elysia 1.4.31the chat message (?msg=)a⏎event: forged⏎⏎data: pwnedthe routenew Elysia() .get('/feed', function* ({ query }) { yield sse({ event: 'chat', data: query.msg }) })the wire: text/event-streamevent: chatdata: aevent: forged(blank line: dispatch)data: pwned(blank line: dispatch)event: chatdata: adata: event: forgeddata: data: data: pwned(blank line: dispatch)the browser: EventSourcetypedataon 'chat'on 'forged'onmessage
Measured on Elysia 1.4.30 and 1.4.31 (Bun 1.4.1) and parsed with the WHATWG event-stream rules. On 1.4.30 the injected event: forged line overwrites the chat type, so the browser fires forged with 'a' and a second message with 'pwned', and the chat listener never fires. On 1.4.31 every line of the message gets its own data: line and one chat event arrives with the text intact.