Skip to content

Commit

Permalink
fix: remove unnecessary toLowerCase (nodejs#1771)
Browse files Browse the repository at this point in the history
  • Loading branch information
anonrig authored and crysmags committed Feb 27, 2024
1 parent 40a355d commit 334a443
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lib/fetch/headers.js
Expand Up @@ -129,8 +129,6 @@ class HeadersList {

// https://fetch.spec.whatwg.org/#concept-header-list-get
get (name) {
name = name.toLowerCase()

// 1. If list does not contain name, then return null.
if (!this.contains(name)) {
return null
Expand All @@ -139,7 +137,7 @@ class HeadersList {
// 2. Return the values of all headers in list whose name
// is a byte-case-insensitive match for name,
// separated from each other by 0x2C 0x20, in order.
return this[kHeadersMap].get(name) ?? null
return this[kHeadersMap].get(name.toLowerCase()) ?? null
}

has (name) {
Expand Down

0 comments on commit 334a443

Please sign in to comment.