mirror of
https://github.com/nextcloud/server.git
synced 2026-06-08 16:26:59 -04:00
Merge pull request #14773 from owncloud/allow-iframes-from-self-in-share-view
Allow iframes from same domain in share view
This commit is contained in:
commit
cf25e6f569
2 changed files with 11 additions and 1 deletions
|
|
@ -203,7 +203,12 @@ class ShareController extends Controller {
|
|||
$shareTmpl['downloadURL'] = $this->urlGenerator->linkToRouteAbsolute('files_sharing.sharecontroller.downloadShare', array('token' => $token));
|
||||
$shareTmpl['maxSizeAnimateGif'] = $this->config->getSystemValue('max_filesize_animated_gifs_public_sharing', 10);
|
||||
|
||||
return new TemplateResponse($this->appName, 'public', $shareTmpl, 'base');
|
||||
$csp = new OCP\AppFramework\Http\ContentSecurityPolicy();
|
||||
$csp->addAllowedFrameDomain('\'self\'');
|
||||
$response = new TemplateResponse($this->appName, 'public', $shareTmpl, 'base');
|
||||
$response->setContentSecurityPolicy($csp);
|
||||
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -159,7 +159,12 @@ class ShareControllerTest extends \Test\TestCase {
|
|||
'nonHumanFileSize' => 33,
|
||||
'maxSizeAnimateGif' => 10,
|
||||
);
|
||||
|
||||
$csp = new \OCP\AppFramework\Http\ContentSecurityPolicy();
|
||||
$csp->addAllowedFrameDomain('\'self\'');
|
||||
$expectedResponse = new TemplateResponse($this->container['AppName'], 'public', $sharedTmplParams, 'base');
|
||||
$expectedResponse->setContentSecurityPolicy($csp);
|
||||
|
||||
$this->assertEquals($expectedResponse, $response);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue