From 4a10638fb620d4bf0a29a05930f73dfce0bdba5a Mon Sep 17 00:00:00 2001 From: Gaurish Sethia Date: Sat, 23 Dec 2023 04:24:05 +0000 Subject: [PATCH] util: pass invalidSubtypeIndex instead of trimmedSubtype to error --- 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 [