fix: support multiple keys per action and harden runtime/parsing
This commit is contained in:
@@ -22,3 +22,10 @@ test("parseSse joins multi-line data fields with newline", () => {
|
||||
assert.equal(messages.length, 1);
|
||||
assert.equal(messages[0].data, "line1\nline2");
|
||||
});
|
||||
|
||||
test("parseSse normalizes CRLF-delimited events", () => {
|
||||
const { messages, rest } = parseSse("data:hello\r\n\r\n");
|
||||
assert.equal(rest, "");
|
||||
assert.equal(messages.length, 1);
|
||||
assert.equal(messages[0].data, "hello");
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user