Skip to content

Commit

Permalink
[issue-nextcloud#39] Adjust PageController for development setup.
Browse files Browse the repository at this point in the history
  • Loading branch information
charismatic-claire committed Nov 9, 2018
1 parent 2aa8877 commit ba3dbd3
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion lib/Controller/PageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

namespace OCA\Contacts\Controller;

use OC\Security\CSP\ContentSecurityPolicy;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http\TemplateResponse;
use OCP\IRequest;
Expand All @@ -47,7 +48,15 @@ public function __construct(string $AppName,
public function index(): TemplateResponse {
$params = ['user' => $this->userId];

return new TemplateResponse('contacts', 'main', $params); // templates/main.php
// fix content security policy issue
$response = new TemplateResponse('contacts', 'main', $params); // templates/main.php
$csp = new ContentSecurityPolicy();
$csp->allowEvalScript();
$csp->allowInlineScript();
$csp->allowInlineStyle();
$response->setContentSecurityPolicy($csp);

return $response;
}

/**
Expand Down

0 comments on commit ba3dbd3

Please sign in to comment.