From 9d2a899bba0e99ac4566452cfd58e338b94792b9 Mon Sep 17 00:00:00 2001 From: MaximkaHuman Date: Tue, 21 Jun 2022 18:35:55 +0300 Subject: [PATCH] Fixed multipart/form-data request was not ending with \r\n. (#999) This issue caused that CGI server did not get file payload. --- src/utils/httpRequestParser.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/httpRequestParser.ts b/src/utils/httpRequestParser.ts index 9f825e2d..3b0aeeae 100644 --- a/src/utils/httpRequestParser.ts +++ b/src/utils/httpRequestParser.ts @@ -216,7 +216,7 @@ export class HttpRequestParser implements RequestParser { combinedStream.append(line); } - if (index !== lines.length - 1) { + if (index < lines.length) { combinedStream.append(this.getLineEnding(contentTypeHeader)); } }