mirror of
https://github.com/nerzhul/ocsms.git
synced 2025-06-07 07:56:23 +00:00
Fix CSP issue with vue.js
This commit is contained in:
parent
c9d929e0a7
commit
e6a2214bc9
@ -80,7 +80,21 @@ class SmsController extends Controller {
|
|||||||
$params = array('user' => $this->userId,
|
$params = array('user' => $this->userId,
|
||||||
'mailboxes' => $mboxes
|
'mailboxes' => $mboxes
|
||||||
);
|
);
|
||||||
return new TemplateResponse($this->appName, 'main', $params);
|
$response = new TemplateResponse($this->appName, 'main', $params);
|
||||||
|
$this->addContentSecurityToResponse($response);
|
||||||
|
return $response;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Adds the domain "data:" to the allowed image domains
|
||||||
|
* this function is called by reference
|
||||||
|
*
|
||||||
|
* @param TemplateResponse $response
|
||||||
|
*/
|
||||||
|
private function addContentSecurityToResponse($response) {
|
||||||
|
$csp = new Http\ContentSecurityPolicy();
|
||||||
|
$csp->allowEvalScript(true);
|
||||||
|
$response->setContentSecurityPolicy($csp);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user