[regression] Normalize header names to lowercase

Related commit:
https://github.com/gorhill/uBlock/commit/408b538e75
This commit is contained in:
Raymond Hill 2025-07-05 10:59:22 -04:00
parent 76b72c9e65
commit b398bd8487
No known key found for this signature in database
GPG key ID: 25E1490B761470C2

View file

@ -300,9 +300,8 @@ const $httpHeaders = {
},
lookup(name) {
if ( this.parsed.size === 0 ) {
for ( let i = 0, n = this.headers.length; i < n; i++ ) {
const { name, value } = this.headers[i];
this.parsed.set(name, value);
for ( const { name, value } of this.headers ) {
this.parsed.set(name.toLowerCase(), value);
}
}
return this.parsed.get(name);