Skip to content

Commit

Permalink
Merge pull request nextcloud#13420 from nextcloud/enh/13042/default-f…
Browse files Browse the repository at this point in the history
…rame-anchestor-set

Set default frame-ancestors to 'self'
  • Loading branch information
rullzer authored Jan 9, 2019
2 parents b8bb1d4 + ad676c0 commit 1fd6741
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 63 deletions.
4 changes: 3 additions & 1 deletion lib/public/AppFramework/Http/ContentSecurityPolicy.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,9 @@ class ContentSecurityPolicy extends EmptyContentSecurityPolicy {
protected $allowedChildSrcDomains = [];

/** @var array Domains which can embed this Nextcloud instance */
protected $allowedFrameAncestors = [];
protected $allowedFrameAncestors = [
'\'self\'',
];

/** @var array Domains from which web-workers can be loaded */
protected $allowedWorkerSrcDomains = [];
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/AppFramework/Controller/ControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public function testFormatDataResponseJSON() {
'test' => 'something',
'Cache-Control' => 'no-cache, no-store, must-revalidate',
'Content-Type' => 'application/json; charset=utf-8',
'Content-Security-Policy' => "default-src 'none';base-uri 'none';manifest-src 'self';script-src 'self';style-src 'self' 'unsafe-inline';img-src 'self' data: blob:;font-src 'self' data:;connect-src 'self';media-src 'self'",
'Content-Security-Policy' => "default-src 'none';base-uri 'none';manifest-src 'self';script-src 'self';style-src 'self' 'unsafe-inline';img-src 'self' data: blob:;font-src 'self' data:;connect-src 'self';media-src 'self';frame-ancestors 'self'",
];

$response = $this->controller->customDataResponse(array('hi'));
Expand Down
Loading

0 comments on commit 1fd6741

Please sign in to comment.