From c09333f94b2d1b57f1cda41bff166deed2d9a7fa Mon Sep 17 00:00:00 2001 From: Nick Cronquist Date: Tue, 30 Jul 2019 15:32:01 -0700 Subject: [PATCH] Matches Header Names Case Insensitively - The extension was matching the response rule header names exactly rather than ignoring the case and that was causing the * scoped origin header to be appended to nothing (with a comma) instead of replacing nothing --- app/js/background.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/js/background.js b/app/js/background.js index 610e41c..cffb2cf 100644 --- a/app/js/background.js +++ b/app/js/background.js @@ -89,7 +89,7 @@ var requestListener = function (details) { var flag = false; details.requestHeaders.forEach(function (header) { - if (header.name === rule.data.name) { + if (header.name.toLowerCase() === rule.data.name.toLowerCase()) { flag = true; if (rule.fn) { rule.fn.call(null, rule, header, details); @@ -129,7 +129,7 @@ var responseListener = function (details) { details.responseHeaders.forEach(function (header) { // if rule exist in response - rewrite value - if (header.name === rule.data.name) { + if (header.name.toLowerCase() === rule.data.name.toLowerCase()) { flag = true; if (rule.fn) { rule.fn.call(null, rule.data, header, details);