File tree Expand file tree Collapse file tree 2 files changed +37
-1
lines changed Expand file tree Collapse file tree 2 files changed +37
-1
lines changed Original file line number Diff line number Diff line change 6161 // default-src fallback
6262 = Array . from ( defaults )
6363
64+ , sandboxes // base-uri
65+ // default-src fallback
66+ = [ /*
67+ allow-forms
68+ , allow-popups
69+ , allow-modals
70+ , allow-scripts
71+ , allow-same-origin
72+ , allow-presentation
73+ , allow-pointer-lock
74+ , allow-top-navigation
75+ , allow-orientation-lock
76+ , allow-popups-to-escape-sandbox
77+ */ ]
78+
6479
6580, directives = [
6681 // Reporting directives
8095
8196// Document directives
8297 , `base-uri ${ bases . join ` ` } `
83- // , `sandbox ${ sandboxes.join ` ` }`
98+ // `sandbox ...` is not supported in the <meta> element
99+ // or by the Content-Security-policy-Report-Only header field.
100+ // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/sandbox
101+ , `sandbox ${ sandboxes . join ` ` } `
84102// , `plugin-types ${ plugins.join ` ` }`
85103
86104// Navigation Directives
Original file line number Diff line number Diff line change @@ -248,6 +248,24 @@ test ("Content-Security-Policy: base-uri", async t => {
248248})
249249
250250
251+ test ("Content-Security-Policy: sandbox", async t => {
252+
253+ const
254+ server = (new Server).serve ``
255+
256+ , response = await
257+ fetch ('http://localhost:8181/')
258+
259+ , policy = response.headers.get ('content-security-policy')
260+
261+
262+ t.ok ( policy.includes (`sandbox`) )
263+
264+ server.close ``
265+ t.end ()
266+ })
267+
268+
251269test ("Content-Security-Policy: block-all-mixed-content", async t => {
252270
253271 const
You can’t perform that action at this time.
0 commit comments