Skip to content

Commit 896da1c

Browse files
committed
Handle CRLF line endings consistently in SSE frame parsing
1 parent 692e6c7 commit 896da1c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • packages/managed-auth-react/src/lib

packages/managed-auth-react/src/lib/api.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ export function streamManagedAuthEvents(
230230

231231
let eventType = "";
232232
let data = "";
233-
for (const line of raw.split("\n")) {
233+
for (const line of raw.split(/\r\n|\r|\n/)) {
234234
if (line.startsWith("event: ")) eventType = line.slice(7);
235235
else if (line.startsWith("data: ")) data = line.slice(6);
236236
}

0 commit comments

Comments
 (0)