Merge pull request #2087 from nextcloud/fix/embeded-csp

Allow embedding in the CSP
This commit is contained in:
Roeland Jago Douma 2020-03-18 19:22:26 +01:00 committed by GitHub
commit 6a94f1c396
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -23,6 +23,7 @@ declare(strict_types=1);
namespace OCA\Calendar\Controller;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http\ContentSecurityPolicy;
use OCP\AppFramework\Http\TemplateResponse;
use OCP\IConfig;
use OCP\IInitialStateService;
@ -97,6 +98,10 @@ class PublicViewController extends Controller {
$response = $this->publicIndex($token, 'base');
$response->addHeader('X-Frame-Options', 'ALLOW');
$csp = new ContentSecurityPolicy();
$csp->addAllowedFrameAncestorDomain('*');
$response->setContentSecurityPolicy($csp);
return $response;
}