summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2016-02-28 20:00:11 -0500
committerFrederic Guillot <fred@kanboard.net>2016-02-28 20:00:11 -0500
commita22476ffdfe568e9006ef243c4aa3a8cf0bc627a (patch)
treef2737ccefe02e347b5693c83a933c56fc97018b0
parent333bec112ae34e3e8435153355f3ae0ba407f515 (diff)
Added support for HTTP header "X-Forwarded-Proto: https"
-rw-r--r--ChangeLog11
-rw-r--r--app/Core/Http/Request.php6
-rw-r--r--tests/units/Core/Http/RequestTest.php6
3 files changed, 20 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index a869925c..82c4ad78 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,11 +1,18 @@
+Version 1.0.27 (unreleased)
+--------------
+
+Improvements:
+
+* Added support for HTTP header "X-Forwarded-Proto: https"
+
Version 1.0.26
--------------
Breaking changes:
* API procedures:
- - "moveColumnUp" and "moveColumnDown" are replace by "changeColumnPosition"
- - "moveSwimlaneUp" and "moveSwimlaneDown" are replace by "changeSwimlanePosition"
+ - "moveColumnUp" and "moveColumnDown" are replaced by "changeColumnPosition"
+ - "moveSwimlaneUp" and "moveSwimlaneDown" are replaced by "changeSwimlanePosition"
New features:
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';
}
/**
diff --git a/tests/units/Core/Http/RequestTest.php b/tests/units/Core/Http/RequestTest.php
index 217698f9..6fa796f7 100644
--- a/tests/units/Core/Http/RequestTest.php
+++ b/tests/units/Core/Http/RequestTest.php
@@ -102,6 +102,12 @@ class RequestTest extends Base
$request = new Request($this->container, array('HTTPS' => '1'), array(), array(), array(), array());
$this->assertTrue($request->isHTTPS());
+
+ $request = new Request($this->container, array('HTTP_X_FORWARDED_PROTO' => 'https'), array(), array(), array(), array());
+ $this->assertTrue($request->isHTTPS());
+
+ $request = new Request($this->container, array('HTTP_X_FORWARDED_PROTO' => 'http'), array(), array(), array(), array());
+ $this->assertFalse($request->isHTTPS());
}
public function testGetCookie()