Skip to content

Commit

Permalink
Allow opening pdf attachements
Browse files Browse the repository at this point in the history
  • Loading branch information
VicDeo committed Nov 22, 2019
1 parent fb10f5e commit 2c5326f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions controller/displaycontroller.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public function showPdfViewer() {
$policy->addAllowedChildSrcDomain('\'self\'');
$policy->addAllowedFontDomain('data:');
$policy->addAllowedImageDomain('*');
$policy->addAllowedConnectDomain('blob:');
$policy->allowEvalScript(false);
$response->setContentSecurityPolicy($policy);

Expand Down
2 changes: 1 addition & 1 deletion js/workersrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
**/
function redirectIfNotDisplayedInFrame () {
try {
if (window.frameElement) {
if (window.frameElement || location.href.indexOf('?file=blob') !== false) {
return;
}
} catch (e) {}
Expand Down
1 change: 1 addition & 0 deletions tests/unit/controller/displaycontrollertest.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ public function testShowPdfViewer() {
$policy->addAllowedChildSrcDomain('\'self\'');
$policy->addAllowedFontDomain('data:');
$policy->addAllowedImageDomain('*');
$policy->addAllowedConnectDomain('blob:');
$policy->allowEvalScript(false);
$expectedResponse->setContentSecurityPolicy($policy);

Expand Down

0 comments on commit 2c5326f

Please sign in to comment.