Skip to content

Commit

Permalink
Updated for custom CSP changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Fmstrat committed Jul 9, 2015
1 parent d23bf62 commit d95879d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions controller/pagecontroller.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
use \OCP\IRequest;
use \OCP\AppFramework\Http\TemplateResponse;
use \OCP\AppFramework\Controller;
use \OCP\AppFramework\Http\ContentSecurityPolicy;

class PageController extends Controller {

Expand All @@ -37,7 +38,11 @@ public function __construct($appName, IRequest $request, $userId){
* @NoCSRFRequired
*/
public function index() {
$params = array('user' => $this->userId);
return new TemplateResponse('ownnote', 'main', $params); // templates/main.php
$params = array('user' => $this->userId);
$csp = new \OCP\AppFramework\Http\ContentSecurityPolicy();
$csp->addAllowedImageDomain('data:');
$response = new TemplateResponse('ownnote', 'main', $params);
$response->setContentSecurityPolicy($csp);
return $response;
}
}

0 comments on commit d95879d

Please sign in to comment.