summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2010-07-26 08:54:03 +0000
committeralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2010-07-26 08:54:03 +0000
commite8c11c4a5854d7665f4407feee3673e31d917bd5 (patch)
treed64862afabb5cb254d456ae47bde2b3238baf8cb
parente73d0c5755683a06df71befaed250055aee5b9e0 (diff)
- Support HTTP_X_FORWARDED_PROTO header for HTTPS detecting (#1486866)
git-svn-id: https://svn.roundcube.net/trunk@3828 208e9e7b-5314-0410-a742-e7e81cd9613c
-rw-r--r--roundcubemail/CHANGELOG1
-rw-r--r--roundcubemail/program/include/main.inc4
2 files changed, 4 insertions, 1 deletions
diff --git a/roundcubemail/CHANGELOG b/roundcubemail/CHANGELOG
index 28abdf8b7..aab214b3f 100644
--- a/roundcubemail/CHANGELOG
+++ b/roundcubemail/CHANGELOG
@@ -1,6 +1,7 @@
CHANGELOG RoundCube Webmail
===========================
+- Support HTTP_X_FORWARDED_PROTO header for HTTPS detecting (#1486866)
- Fix default IMAP port configuration (#1486864)
- Create Sent folder when starting to compose a new message (#1486802)
- Fix handling of messages with Content-Type: application/* and no filename (#1484050)
diff --git a/roundcubemail/program/include/main.inc b/roundcubemail/program/include/main.inc
index 8b8a7d23b..ff535947d 100644
--- a/roundcubemail/program/include/main.inc
+++ b/roundcubemail/program/include/main.inc
@@ -1525,9 +1525,11 @@ function rcube_html_editor($mode='')
function rcube_https_check($port=null, $use_https=true)
{
global $RCMAIL;
-
+
if (!empty($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) != 'off')
return true;
+ if (!empty($_SERVER['HTTP_X_FORWARDED_PROTO']) && strtolower($_SERVER['HTTP_X_FORWARDED_PROTO']) == 'https')
+ return true;
if ($port && $_SERVER['SERVER_PORT'] == $port)
return true;
if ($use_https && isset($RCMAIL) && $RCMAIL->config->get('use_https'))