Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
die_coolen_jungs
our_own_cloud_project
Commits
cf25e6f5
Commit
cf25e6f5
authored
Mar 11, 2015
by
Lukas Reschke
Browse files
Merge pull request #14773 from owncloud/allow-iframes-from-self-in-share-view
Allow iframes from same domain in share view
parents
dbade193
48243a29
Changes
2
Hide whitespace changes
Inline
Side-by-side
apps/files_sharing/lib/controllers/sharecontroller.php
View file @
cf25e6f5
...
...
@@ -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
;
}
/**
...
...
apps/files_sharing/tests/controller/sharecontroller.php
View file @
cf25e6f5
...
...
@@ -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
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment