Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/files_pdfviewer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDaniel Calviño Sánchez <danxuliu@gmail.com>2021-01-28 15:32:42 +0300
committerDaniel Calviño Sánchez <danxuliu@gmail.com>2021-01-28 16:01:10 +0300
commitcf41c802ab3f4b6ec15656d28ad86a8a33906c1e (patch)
tree9f0940c72e4e2f2cbfa73de4c664b480d8a14176 /tests
parent6c4a18e53a59178f5aee0678832962a3ce088103 (diff)
Fix PDF viewer failing on Edge (not based on Chromium)
Since version v2.4.456 the PDF.js library is published as two different packages, a non-translated/non-polyfilled build for modern browsers and an ES5 compatible build for older browsers. The PDF viewer was using the build for modern browsers, so it did not work, for example, on Edge (the original version not based on Chromium). This has been changed to use the ES5 build instead for maximum compatibility. Unfortunately, the ES5 build requires allowing "unsafe-eval" in the iframe where the PDF.js library is loaded. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/Unit/Controller/DisplayControllerTest.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/Unit/Controller/DisplayControllerTest.php b/tests/Unit/Controller/DisplayControllerTest.php
index 0caa6d6..a209d18 100644
--- a/tests/Unit/Controller/DisplayControllerTest.php
+++ b/tests/Unit/Controller/DisplayControllerTest.php
@@ -62,7 +62,7 @@ class DisplayControllerTest extends TestCase {
$policy->addAllowedChildSrcDomain('\'self\'');
$policy->addAllowedFontDomain('data:');
$policy->addAllowedImageDomain('*');
- $policy->allowEvalScript(false);
+ $policy->allowEvalScript(true);
$expectedResponse->setContentSecurityPolicy($policy);
$this->assertEquals($expectedResponse, $this->controller->showPdfViewer());