Improved: Method to remove metadata (#179)

This commit is contained in:
nobody 2020-11-22 09:45:35 +01:00
parent 602cde94b6
commit 87a65a8687
No known key found for this signature in database
GPG Key ID: 8F6DE3D614FCFD7A
1 changed files with 4 additions and 8 deletions

View File

@ -53,14 +53,10 @@ requestSanitizer._stripMetadata = function (requestDetails) {
allowlistedDomains = stateManager._domainIsListed(initiatorDomain);
if (allowlistedDomains) {
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);
for (let i = 0; i < requestDetails.requestHeaders.length; ++i) {
if (sensitiveHeaders.indexOf(requestDetails.requestHeaders[i].name) > -1) {
requestDetails.requestHeaders.splice(i--, 1);
}
}
}