Fixed typo causing CSP-based media blocking to skip requests with no content-type header.

This commit is contained in:
hackademix 2020-10-03 15:03:02 +02:00
parent 69f14bf23f
commit 6a07c055e0
1 changed files with 1 additions and 1 deletions

View File

@ -16,7 +16,7 @@ function ReportingCSP(marker, reportURI = "") {
let blocker; let blocker;
if (capabilities) { if (capabilities) {
let contentType = responseHeaders.filter(h => h.name.toLowerCase() === "content-type"); let contentType = responseHeaders.filter(h => h.name.toLowerCase() === "content-type");
let blockHTTP = contentType.lentgh === 0 || contentType.some(h => !/^(?:text|application)\/\S*\b(?:x?ht|x)ml\b/i.test(h.name)); let blockHTTP = contentType.length === 0 || contentType.some(h => !/^(?:text|application)\/\S*\b(?:x?ht|x)ml\b/i.test(h.name));
blocker = this.buildFromCapabilities(capabilities, blockHTTP); blocker = this.buildFromCapabilities(capabilities, blockHTTP);
} }
let extras = []; let extras = [];