We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 68d0cd0 commit c94cd48Copy full SHA for c94cd48
src/lib/CSP.js
@@ -1,23 +1,23 @@
1
"use strict";
2
3
class CSP {
4
-
+
5
build(...directives) {
6
return directives.join(';');
7
}
8
9
buildBlocker(...types) {
10
return this.build(...(types.map(type => `${type.name || type}-src ${type.value || "'none'"}`)));
11
12
13
blocks(header, type) {
14
return `;${header};`.includes(`;${type}-src 'none';`)
15
16
17
asHeader(value) {
18
return {name: CSP.headerName, value};
19
20
21
22
-CSP.isEmbedType = type => /\b(?:application|video|audio)\b/.test(type);
+CSP.isEmbedType = type => /\b(?:application|video|audio)\b/.test(type) && type !== "application/xhtml+xml";
23
CSP.headerName = "content-security-policy";
0 commit comments