Skip to content

Commit

Permalink
Adjustment to CSP for embed form (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
mwalbeck authored Jul 25, 2022
1 parent 20d37a1 commit 93465e4
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions lib/Controller/PageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,18 +175,12 @@ public function cncfEmb() {
}

function setEmbCsp($tr, $userId) {

$ad = $this->c->getAppValue(
$this->appName,
'emb_afad_' . $userId);
if (strlen($ad) > 3) {
$csp = $tr->getContentSecurityPolicy();
if ($csp === null) {
$csp = new ContentSecurityPolicy();
$tr->setContentSecurityPolicy($csp);
}
$csp->addAllowedFrameAncestorDomain($ad);
$csp = $tr->getContentSecurityPolicy();
if ($csp === null) {
$csp = new ContentSecurityPolicy();
$tr->setContentSecurityPolicy($csp);
}
$csp->addAllowedFrameAncestorDomain("'*'");
}

// ---- END EMBEDDABLE -----
Expand Down

0 comments on commit 93465e4

Please sign in to comment.