Skip to content

Commit c94cd48

Browse files
committed
Fixed placeholders missing for some blocked embeddings (Tor ticket #28720).
1 parent 68d0cd0 commit c94cd48

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/lib/CSP.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
"use strict";
22

33
class CSP {
4-
4+
55
build(...directives) {
66
return directives.join(';');
77
}
8-
8+
99
buildBlocker(...types) {
1010
return this.build(...(types.map(type => `${type.name || type}-src ${type.value || "'none'"}`)));
1111
}
12-
12+
1313
blocks(header, type) {
1414
return `;${header};`.includes(`;${type}-src 'none';`)
1515
}
16-
16+
1717
asHeader(value) {
1818
return {name: CSP.headerName, value};
1919
}
2020
}
2121

22-
CSP.isEmbedType = type => /\b(?:application|video|audio)\b/.test(type);
22+
CSP.isEmbedType = type => /\b(?:application|video|audio)\b/.test(type) && type !== "application/xhtml+xml";
2323
CSP.headerName = "content-security-policy";

0 commit comments

Comments
 (0)