From e31a7b39216728768b9f60c51b9098a6dea3dd76 Mon Sep 17 00:00:00 2001 From: Ruakij Date: Fri, 22 Dec 2023 17:52:02 +0100 Subject: [PATCH] Server-Sent-Events compliance: Allow space in front of value --- src/api/helper.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/helper.ts b/src/api/helper.ts index 80782d076..926db084a 100644 --- a/src/api/helper.ts +++ b/src/api/helper.ts @@ -9,7 +9,7 @@ export const parseEventSource = ( .map((chunk) => { const jsonString = chunk .split('\n') - .map((line) => line.replace(/^data: /, '')) + .map((line) => line.replace(/^data: ?/, '')) .join(''); if (jsonString === '[DONE]') return jsonString; try {