util: pass invalidSubtypeIndex instead of trimmedSubtype to error

PR-URL: https://github.com/nodejs/node/pull/51264
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Deokjin Kim <deokjin81.kim@gmail.com>
This commit is contained in:
Gaurish Sethia authored and RafaelGSS committed 2024-01-02 15:05:26 -03:00
1 parent 684dd9db2f
commit f4f781d493
1 file changed
+1 -1
+1 -1
View File
@@ -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 [