Skip to content

Commit

Permalink
Merge pull request #196 from owncloud/bugfix/e3377
Browse files Browse the repository at this point in the history
Allow opening pdf attachements
  • Loading branch information
micbar authored Nov 25, 2019
2 parents fb10f5e + 2c5326f commit b9db381
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 b9db381

Please sign in to comment.