Skip to content

Commit

Permalink
Add the framesrc csp by default
Browse files Browse the repository at this point in the history
Since we want to iframe the pdfviewer we need to properly set it. Else
it might not work on some pages.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
  • Loading branch information
rullzer committed Aug 18, 2020
1 parent 2ddd8eb commit 40803be
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/AppInfo/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,14 @@

namespace OCA\Files_PDFViewer\AppInfo;

use OCA\Files_PDFViewer\Listeners\CSPListener;
use OCA\Files_PDFViewer\Listeners\LoadViewerListener;
use OCA\Viewer\Event\LoadViewer;
use OCP\AppFramework\App;
use OCP\AppFramework\Bootstrap\IBootContext;
use OCP\AppFramework\Bootstrap\IBootstrap;
use OCP\AppFramework\Bootstrap\IRegistrationContext;
use OCP\Security\CSP\AddContentSecurityPolicyEvent;
use OCP\Util;

class Application extends App implements IBootstrap {
Expand All @@ -44,6 +46,7 @@ public function __construct() {

public function register(IRegistrationContext $context): void {
$context->registerEventListener(LoadViewer::class, LoadViewerListener::class);
$context->registerEventListener(AddContentSecurityPolicyEvent::class, CSPListener::class);
}

public function boot(IBootContext $context): void {
Expand Down

0 comments on commit 40803be

Please sign in to comment.