Commit dd46efdc authored by Simon Chabot's avatar Simon Chabot
Browse files

[extension, getHeaders] Use a caseless comparison to get the response headers

The headers can be capitalized or not.  For instance « content-type » and «
Content-Type » should be treated equally, therefore we should make a caseless
comparison to get the requested headers.
parent 20727e021fe8
......@@ -102,7 +102,7 @@ function getHeader(
): string | null {
if (headers === undefined) return null;
for (let i = 0; i !== headers.length; i++) {
if (headers[i].name === name) {
if (headers[i].name.toLowerCase() === name.toLowerCase()) {
let v = headers[i].value;
if (v !== undefined) return v;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment