Fix CSP violation reporting management of "fake" blocked-uri like "eval".
This commit is contained in:
parent
6c60ab2710
commit
f9f116e65c
|
@ -443,7 +443,7 @@ var RequestGuard = (() => {
|
||||||
let blockedURI = report['blocked-uri'];
|
let blockedURI = report['blocked-uri'];
|
||||||
if (blockedURI && blockedURI !== 'self') {
|
if (blockedURI && blockedURI !== 'self') {
|
||||||
let r = fakeRequestFromCSP(report, request);
|
let r = fakeRequestFromCSP(report, request);
|
||||||
if (r.url === 'inline') r.url = request.documentUrl;
|
if (!/:/.test(r.url)) r.url = request.documentUrl;
|
||||||
Content.reportTo(r, false, policyTypesMap[r.type]);
|
Content.reportTo(r, false, policyTypesMap[r.type]);
|
||||||
TabStatus.record(r, "blocked");
|
TabStatus.record(r, "blocked");
|
||||||
} else if (report["violated-directive"] === "script-src" && /; script-src 'none'/.test(report["original-policy"])) {
|
} else if (report["violated-directive"] === "script-src" && /; script-src 'none'/.test(report["original-policy"])) {
|
||||||
|
|
Loading…
Reference in New Issue