Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
ai3
docker
roundcube
Commits
7506d45f
Commit
7506d45f
authored
Oct 18, 2020
by
ale
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support report-to and report-uri in the CSP plugin
parent
25cf829b
Pipeline
#9276
passed with stages
in 3 minutes and 16 seconds
Changes
1
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
plugins/csp/csp.php
plugins/csp/csp.php
+8
-0
No files found.
plugins/csp/csp.php
View file @
7506d45f
...
...
@@ -30,6 +30,14 @@ class csp extends rcube_plugin {
"script-src 'self'
{
$proto
}
://
{
$host
}{
$path
}
'unsafe-inline' 'unsafe-eval'
{
$src_sso
}
; "
.
"style-src 'self' 'unsafe-inline'
{
$src_sso
}
; "
.
"object-src 'none'"
);
$report_uri
=
$rcmail
->
config
->
get
(
'csp_report_uri'
,
''
);
if
(
$report_uri
!=
''
)
{
$csp_header
.
=
'; report-uri '
.
$report_uri
;
}
$report_to
=
$rcmail
->
config
->
get
(
'csp_report_to'
,
''
);
if
(
$report_to
!=
''
)
{
$csp_header
.
=
'; report-to '
.
$report_to
;
}
header
(
"Content-Security-Policy:
{
$csp_header
}
"
);
return
$content
;
}
...
...
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