Skip to content

Commit 6fe4c8c

Browse files
Update lib/internal/mime.js
Co-authored-by: Nikita Skovoroda <[email protected]>
1 parent 57b817f commit 6fe4c8c

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

lib/internal/mime.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,15 @@ const END_BEGINNING_WHITESPACE = /[^\r\n\t ]|$/;
2323
const START_ENDING_WHITESPACE = /[\r\n\t ]*$/;
2424

2525
function toASCIILower(str) {
26-
return StringPrototypeToLowerCase(str);
26+
if (!/[^\x00-\x7f]/.test(str)) return StringPrototypeToLowerCase(str);
27+
for (let i = 0; i < str.length; i++) {
28+
const char = str[i];
29+
30+
result += char >= 'A' && char <= 'Z' ?
31+
StringPrototypeToLowerCase(char) :
32+
char;
33+
}
34+
return result;
2735
}
2836

2937
const SOLIDUS = '/';

0 commit comments

Comments
 (0)