From a22476ffdfe568e9006ef243c4aa3a8cf0bc627a Mon Sep 17 00:00:00 2001
From: Frederic Guillot <fred@kanboard.net>
Date: Sun, 28 Feb 2016 20:00:11 -0500
Subject: Added support for HTTP header "X-Forwarded-Proto: https"

---
 app/Core/Http/Request.php | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

(limited to 'app/Core')

diff --git a/app/Core/Http/Request.php b/app/Core/Http/Request.php
index 1b3036d5..7f1399e6 100644
--- a/app/Core/Http/Request.php
+++ b/app/Core/Http/Request.php
@@ -211,7 +211,11 @@ class Request extends Base
      */
     public function isHTTPS()
     {
-        return isset($this->server['HTTPS']) && $this->server['HTTPS'] !== '' && $this->server['HTTPS'] !== 'off';
+        if ($this->getServerVariable('HTTP_X_FORWARDED_PROTO') === 'https') {
+            return true;
+        }
+
+        return $this->getServerVariable('HTTPS') !== '' && $this->server['HTTPS'] !== 'off';
     }
 
     /**
-- 
cgit v1.2.3