mirror of
https://github.com/nextcloud/server.git
synced 2026-06-08 16:26:59 -04:00
Fix preview service worker
Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com> Update ViewControllerTest.php Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com> Update ViewController.php Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
This commit is contained in:
parent
ff1f3a0a28
commit
2c11f23e97
3 changed files with 4 additions and 0 deletions
|
|
@ -400,6 +400,7 @@ class ApiController extends Controller {
|
|||
/**
|
||||
* @NoAdminRequired
|
||||
* @NoCSRFRequired
|
||||
* @PublicPage
|
||||
*/
|
||||
public function serviceWorker(): StreamResponse {
|
||||
$response = new StreamResponse(__DIR__ . '/../../../../dist/preview-service-worker.js');
|
||||
|
|
|
|||
|
|
@ -320,6 +320,8 @@ class ViewController extends Controller {
|
|||
);
|
||||
$policy = new ContentSecurityPolicy();
|
||||
$policy->addAllowedFrameDomain('\'self\'');
|
||||
// Allow preview service worker
|
||||
$policy->addAllowedWorkerSrcDomain('\'self\'');
|
||||
$response->setContentSecurityPolicy($policy);
|
||||
|
||||
$this->provideInitialState($dir, $openfile);
|
||||
|
|
|
|||
|
|
@ -402,6 +402,7 @@ class ViewControllerTest extends TestCase {
|
|||
);
|
||||
$policy = new Http\ContentSecurityPolicy();
|
||||
$policy->addAllowedFrameDomain('\'self\'');
|
||||
$policy->addAllowedWorkerSrcDomain('\'self\'');
|
||||
$expected->setContentSecurityPolicy($policy);
|
||||
|
||||
$this->activityHelper->method('getFavoriteFilePaths')
|
||||
|
|
|
|||
Loading…
Reference in a new issue