Move default-src CSP rule to ClassProvider
It was impossible to override the default-src CSP rule inside a plugin. This commit fixes this limitation by moving the assignation of the rule from Response class to ClassProvider.
This commit is contained in:
parent
cc93b86991
commit
8baa417ece
|
|
@ -220,7 +220,6 @@ class Response extends Base
|
|||
*/
|
||||
public function csp(array $policies = array())
|
||||
{
|
||||
$policies['default-src'] = "'self'";
|
||||
$values = '';
|
||||
|
||||
foreach ($policies as $policy => $acl) {
|
||||
|
|
|
|||
|
|
@ -168,6 +168,7 @@ class ClassProvider implements ServiceProviderInterface
|
|||
};
|
||||
|
||||
$container['cspRules'] = array(
|
||||
'default-src' => "'self'",
|
||||
'style-src' => "'self' 'unsafe-inline'",
|
||||
'img-src' => '* data:',
|
||||
);
|
||||
|
|
|
|||
Loading…
Reference in New Issue