From 4a7ba3c2da2cbbc1f8736e10c2aac48557a4b6c6 Mon Sep 17 00:00:00 2001 From: "alan.zhao" Date: Sat, 20 May 2023 19:12:34 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3data=E4=BC=A0=E8=BE=93?= =?UTF-8?q?=E4=B8=AD=E9=A6=96=E4=BD=8D=E7=A9=BA=E6=A0=BC=E8=A2=AB=E8=BF=87?= =?UTF-8?q?=E6=BB=A4=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/parse.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/parse.ts b/src/parse.ts index c13e3c4..b355075 100644 --- a/src/parse.ts +++ b/src/parse.ts @@ -134,7 +134,7 @@ export function getMessages( // line is of format ":" or ": " // https://html.spec.whatwg.org/multipage/server-sent-events.html#event-stream-interpretation const field = decoder.decode(line.subarray(0, fieldLength)); - const valueOffset = fieldLength + (line[fieldLength + 1] === ControlChars.Space ? 2 : 1); + const valueOffset = fieldLength + 1; const value = decoder.decode(line.subarray(valueOffset)); switch (field) {