mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
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:
parent
26d39e875f
commit
6a1abd2c03
@ -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 [
|
||||
|
Loading…
Reference in New Issue
Block a user