Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e6f89b6b authored by David's avatar David
Browse files

fix for none in object-src. allow chrome to view pdfs again

parent 7173c97c
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -2,6 +2,20 @@

OCP\User::checkLoggedIn();

// code copied from nextcloud /lib/private/legacy/response.php
// fixes object-src: 'none' which blocks chrome from preview pdf
$policy = 'default-src \'self\'; '
           . 'script-src \'self\' \'unsafe-eval\' \'nonce-'.\OC::$server->get
           . 'style-src \'self\' \'unsafe-inline\'; '
           . 'frame-src *; '
           . 'img-src * data: blob:; '
           . 'font-src \'self\' data:; '
           . 'media-src *; '
           . 'connect-src *; '
           . 'object-src \'self\'; '
           . 'base-uri \'self\'; ';
header('Content-Security-Policy:' . $policy);

if (@file_exists(__DIR__.'/app/index.php'))
{
	include_once OC_App::getAppPath('rainloop').'/lib/RainLoopHelper.php';