diff options
author | hackademix | 2020-05-15 21:34:39 +0200 |
---|---|---|
committer | hackademix | 2020-05-15 21:34:39 +0200 |
commit | 212e6e235822684e7f87ca99d29c2600e649b75c (patch) | |
tree | 186cd30d60221e37d0ec593822f8e793b3f8e12b /src | |
parent | 63ca29158ab91373b5722ba667ddb536fb8f62cb (diff) | |
download | noscript-212e6e235822684e7f87ca99d29c2600e649b75c.tar.gz noscript-212e6e235822684e7f87ca99d29c2600e649b75c.tar.xz noscript-212e6e235822684e7f87ca99d29c2600e649b75c.zip |
Fixed hard reload needed after releasing restrictions (regression on Firefox Beta).
Diffstat (limited to 'src')
-rw-r--r-- | src/bg/ReportingCSP.js | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/src/bg/ReportingCSP.js b/src/bg/ReportingCSP.js index fc08527..fb45c6a 100644 --- a/src/bg/ReportingCSP.js +++ b/src/bg/ReportingCSP.js @@ -27,10 +27,10 @@ function ReportingCSP(reportURI, reportGroup) { let needsReportTo = REPORT_TO_SUPPORTED; let blocker = capabilities && this.buildFromCapabilities(capabilities); - for (let h of responseHeaders) { + responseHeaders.forEach((h, index) => { if (this.isMine(h)) { header = h; - h.value = ""; + responseHeaders.splice(index, 1); } else if (needsReportTo && h.name === REPORT_TO.name && h.value === REPORT_TO.value) { needsReportTo = false; @@ -42,18 +42,14 @@ function ReportingCSP(reportURI, reportGroup) { h.value = h.value.slice(0, -url.length) + "data:"; } } - } + }); if (blocker) { if (needsReportTo) { responseHeaders.push(REPORT_TO); } - if (header) { - header.value = blocker; - } else { - header = this.asHeader(blocker); - responseHeaders.push(header); - } + header = this.asHeader(blocker); + responseHeaders.push(header); } return header; |