From 62968612764090ad1775ac365d2de62737884025 Mon Sep 17 00:00:00 2001 From: nobody Date: Sun, 22 Nov 2020 17:06:36 +0100 Subject: [PATCH] Hotfix: Only remove metadata if origin is not on allowed list (#179) --- core/request-sanitizer.js | 12 ++++++++---- pages/updates/updates.html | 33 +++++++++++++++++---------------- 2 files changed, 25 insertions(+), 20 deletions(-) diff --git a/core/request-sanitizer.js b/core/request-sanitizer.js index 5ec2b666..2741f847 100644 --- a/core/request-sanitizer.js +++ b/core/request-sanitizer.js @@ -53,10 +53,14 @@ requestSanitizer._stripMetadata = function (requestDetails) { allowlistedDomains = stateManager._domainIsListed(initiatorDomain); if (allowlistedDomains) { - for (let i = 0; i < requestDetails.requestHeaders.length; ++i) { - if (sensitiveHeaders.indexOf(requestDetails.requestHeaders[i].name) > -1) { - requestDetails.requestHeaders.splice(i--, 1); - } + return { + [WebRequest.HEADERS]: requestDetails.requestHeaders, + }; + } + + for (let i = 0; i < requestDetails.requestHeaders.length; ++i) { + if (sensitiveHeaders.indexOf(requestDetails.requestHeaders[i].name) > -1) { + requestDetails.requestHeaders.splice(i--, 1); } } diff --git a/pages/updates/updates.html b/pages/updates/updates.html index 7f1edb3d..3a37956b 100644 --- a/pages/updates/updates.html +++ b/pages/updates/updates.html @@ -25,7 +25,22 @@ New in LocalCDN:
@@ -59,21 +74,7 @@