refactor: store header keys lower case internally (#10958)

This is a minor optimization that removes some header key lowercasing
that previously happened on access.
This commit is contained in:
Luca Casonato 2021-06-15 16:37:05 +02:00 committed by GitHub
parent b4026dac9c
commit 49ec3d10ad
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 21 additions and 37 deletions

View file

@ -152,10 +152,8 @@
let charset = null;
let essence = null;
let mimeType = null;
const values = getDecodeSplitHeader(
headerListFromHeaders(this[_headers]),
"Content-Type",
);
const headerList = headerListFromHeaders(this[_headers]);
const values = getDecodeSplitHeader(headerList, "content-type");
if (values === null) return null;
for (const value of values) {
const temporaryMimeType = mimesniff.parseMimeType(value);