Skip to content

Commit

Permalink
Merge pull request #5429 from LinneyS/patch-1
Browse files Browse the repository at this point in the history
Allow onlyoffice on the same domain
  • Loading branch information
kulmann authored Jul 1, 2021
2 parents 0fdea7f + 81e2f1e commit 1130ba4
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,14 @@ private function getMimeType(string $filename): string {
}

private function applyCSPOnlyOffice(ContentSecurityPolicy $csp): ContentSecurityPolicy {
$documentServerUrl = $this->extractDomain($this->getOnlyOfficeDocumentServerUrl());
$ooUrl = $this->getOnlyOfficeDocumentServerUrl();
$documentServerUrl = $this->extractDomain($ooUrl);
if (!empty($documentServerUrl)) {
$csp->addAllowedScriptDomain($documentServerUrl);
$csp->addAllowedFrameDomain($documentServerUrl);
}
} else if (!empty($ooUrl)) {
$csp->addAllowedFrameDomain("'self'");
}
return $csp;
}

Expand Down

0 comments on commit 1130ba4

Please sign in to comment.