Skip to content

Commit

Permalink
util: pass invalidSubtypeIndex instead of trimmedSubtype to error
Browse files Browse the repository at this point in the history
PR-URL: #51264
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Deokjin Kim <deokjin81.kim@gmail.com>
  • Loading branch information
gaurishhs authored and RafaelGSS committed Jan 2, 2024
1 parent 684dd9d commit f4f781d
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 f4f781d

Please sign in to comment.