Skip to content

Commit f79ac33

Browse files
gaurishhsrichardlau
authored andcommitted
util: pass invalidSubtypeIndex instead of trimmedSubtype to error
PR-URL: #51264 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Deokjin Kim <[email protected]>
1 parent cab7737 commit f79ac33

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/internal/mime.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ function parseTypeAndSubtype(str) {
7070
const invalidSubtypeIndex = SafeStringPrototypeSearch(trimmedSubtype,
7171
NOT_HTTP_TOKEN_CODE_POINT);
7272
if (trimmedSubtype === '' || invalidSubtypeIndex !== -1) {
73-
throw new ERR_INVALID_MIME_SYNTAX('subtype', str, trimmedSubtype);
73+
throw new ERR_INVALID_MIME_SYNTAX('subtype', str, invalidSubtypeIndex);
7474
}
7575
const subtype = toASCIILower(trimmedSubtype);
7676
return [

0 commit comments

Comments
 (0)