From e7b5c99edab58c5c09d08f54ee647076c2559f55 Mon Sep 17 00:00:00 2001 From: Deokjin Kim Date: Mon, 6 Nov 2023 22:30:28 +0900 Subject: [PATCH] util: fix wrong argument of `ERR_INVALID_MIME_SYNTAX` Third argument of ERR_INVALID_MIME_SYNTAX is invalid index (not string). --- lib/internal/mime.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/internal/mime.js b/lib/internal/mime.js index 0a1d8e7e67916b..07d80a72625cac 100644 --- a/lib/internal/mime.js +++ b/lib/internal/mime.js @@ -70,7 +70,7 @@ function parseTypeAndSubtype(str) { const invalidSubtypeIndex = SafeStringPrototypeSearch(trimmedSubtype, NOT_HTTP_TOKEN_CODE_POINT); if (trimmedSubtype === '' || invalidSubtypeIndex !== -1) { - throw new ERR_INVALID_MIME_SYNTAX('subtype', str, trimmedSubtype); + throw new ERR_INVALID_MIME_SYNTAX('subtype', str, invalidSubtypeIndex); } const subtype = toASCIILower(trimmedSubtype); return [