Skip to content

Commit c34260c

Browse files
samthoradamraine
andauthored
generate x-frame-options and csp equivalent (GoogleChrome#5826)
* generate x-frame-options and csp equivalent * remove colon Co-authored-by: Adam Raine <[email protected]> Co-authored-by: Adam Raine <[email protected]>
1 parent 9674576 commit c34260c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

firebase-config.js

+5
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,13 @@ if (process.env.ELEVENTY_ENV === 'prod') {
2727
value:
2828
`script-src 'strict-dynamic' ${hashList.join(' ')} ` +
2929
`'unsafe-inline' http: https:; object-src 'none'; base-uri 'self'; ` +
30+
`frame-ancestors 'self'; ` +
3031
`report-uri https://csp.withgoogle.com/csp/webdev`,
3132
});
33+
firebaseJson.hosting.headers[0].headers.push({
34+
key: 'X-Frame-Options',
35+
value: 'SAMEORIGIN',
36+
});
3237
}
3338

3439
fs.writeFileSync('./firebase.json', JSON.stringify(firebaseJson, null, 2));

0 commit comments

Comments
 (0)