Add frame-ancestors to allow remote auth
This commit is contained in:
parent
811d031ffd
commit
aa9aaefdea
@ -45,6 +45,9 @@ module.exports = {
|
|||||||
|
|
||||||
// data: is used by codemirror
|
// data: is used by codemirror
|
||||||
"img-src 'self' data: blob:",
|
"img-src 'self' data: blob:",
|
||||||
|
|
||||||
|
// for accounts.cryptpad.fr authentication
|
||||||
|
"frame-ancestors 'self' accounts.cryptpad.fr",
|
||||||
].join('; '),
|
].join('; '),
|
||||||
|
|
||||||
// CKEditor requires significantly more lax content security policy in order to function.
|
// CKEditor requires significantly more lax content security policy in order to function.
|
||||||
|
|||||||
@ -34,6 +34,11 @@ var setHeaders = (function () {
|
|||||||
const headers = clone(config.httpHeaders);
|
const headers = clone(config.httpHeaders);
|
||||||
if (config.contentSecurity) {
|
if (config.contentSecurity) {
|
||||||
headers['Content-Security-Policy'] = clone(config.contentSecurity);
|
headers['Content-Security-Policy'] = clone(config.contentSecurity);
|
||||||
|
if (headers['Content-Security-Policy'].indexOf('frame-ancestors') === -1) {
|
||||||
|
// backward compat for those who do not merge the new version of the config
|
||||||
|
// when updating. This prevents endless spinner if someone clicks donate.
|
||||||
|
headers['Content-Security-Policy'] += "frame-ancestors 'self' accounts.cryptpad.fr;";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
const padHeaders = clone(headers);
|
const padHeaders = clone(headers);
|
||||||
if (config.padContentSecurity) {
|
if (config.padContentSecurity) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user