mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-28 19:49:20 +03:00
Change for insecure images over http
See https://github.com/the-djmaze/snappymail/issues/16#issuecomment-707962963
This commit is contained in:
parent
0528bcf911
commit
0dc093b35b
2 changed files with 2 additions and 1 deletions
|
|
@ -44,6 +44,7 @@ class Service
|
|||
$sContentSecurityPolicy = \trim($this->oActions->Config()->Get('security', 'content_security_policy', '')) ?: APP_DEFAULT_CSP;
|
||||
if ($this->oActions->Config()->Get('security', 'use_local_proxy_for_external_images', '')) {
|
||||
$sContentSecurityPolicy = preg_replace('/(img-src[^;]+)\\shttps:(\\s|;|$)/D', '$1$2', $sContentSecurityPolicy);
|
||||
$sContentSecurityPolicy = preg_replace('/(img-src[^;]+)\\shttp:(\\s|;|$)/D', '$1$2', $sContentSecurityPolicy);
|
||||
}
|
||||
\header('Content-Security-Policy: '.$sContentSecurityPolicy, true);
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
define('APP_USE_APC_CACHE', true);
|
||||
|
||||
// "img-src https:" is allowed due to remote images in e-mails
|
||||
define('APP_DEFAULT_CSP', "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; img-src 'self' data: https:; style-src 'self' 'unsafe-inline'");
|
||||
define('APP_DEFAULT_CSP', "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; img-src 'self' data: https: http:; style-src 'self' 'unsafe-inline'");
|
||||
|
||||
date_default_timezone_set('UTC');
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue