Enforce more restrictive CSP on media/object documents.
This commit is contained in:
parent
2630ade4ea
commit
ec2a46a571
|
@ -13,7 +13,12 @@ function ReportingCSP(marker, reportURI = "") {
|
|||
reportURI,
|
||||
patchHeaders(responseHeaders, capabilities) {
|
||||
let header = null;
|
||||
let blocker = capabilities && this.buildFromCapabilities(capabilities);
|
||||
let blocker;
|
||||
if (capabilities) {
|
||||
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));
|
||||
blocker = this.buildFromCapabilities(capabilities, blockHTTP);
|
||||
}
|
||||
let extras = [];
|
||||
responseHeaders.forEach((h, index) => {
|
||||
if (this.isMine(h)) {
|
||||
|
|
Loading…
Reference in New Issue