Skip to content

Commit 01b027e

Browse files
LukasReschkeblizzz
authored andcommitted
Allow iframes
1 parent 2a8d327 commit 01b027e

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

controller/webviewcontroller.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
namespace OCA\Bookmarks\Controller;
1414

15+
use OCP\AppFramework\Http\ContentSecurityPolicy;
1516
use \OCP\IRequest;
1617
use \OCP\AppFramework\Http\TemplateResponse;
1718
use \OCP\AppFramework\Controller;
@@ -38,7 +39,13 @@ public function __construct($appName, IRequest $request, $userId, $urlgenerator,
3839
public function index() {
3940
$bookmarkleturl = $this->urlgenerator->getAbsoluteURL('index.php/apps/bookmarks/bookmarklet');
4041
$params = array('user' => $this->userId, 'bookmarkleturl' => $bookmarkleturl);
41-
return new TemplateResponse('bookmarks', 'main', $params);
42+
43+
$policy = new ContentSecurityPolicy();
44+
$policy->addAllowedFrameDomain("'self'");
45+
46+
$response = new TemplateResponse('bookmarks', 'main', $params);
47+
$response->setContentSecurityPolicy($policy);
48+
return $response;
4249
}
4350

4451
/**

0 commit comments

Comments
 (0)