Skip to content

Commit

Permalink
util: pass invalidSubtypeIndex instead of trimmedSubtype to error
Browse files Browse the repository at this point in the history
  • Loading branch information
gaurishhs committed Dec 23, 2023
1 parent b8fe07d commit 4a10638
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/internal/mime.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 [
Expand Down

0 comments on commit 4a10638

Please sign in to comment.