Added support for HTTP header "X-Forwarded-Proto: https"

This commit is contained in:
Frederic Guillot
2016-02-28 20:00:11 -05:00
parent 333bec112a
commit a22476ffdf
3 changed files with 20 additions and 3 deletions

View File

@@ -1,11 +1,18 @@
Version 1.0.27 (unreleased)
--------------
Improvements:
* Added support for HTTP header "X-Forwarded-Proto: https"
Version 1.0.26 Version 1.0.26
-------------- --------------
Breaking changes: Breaking changes:
* API procedures: * API procedures:
- "moveColumnUp" and "moveColumnDown" are replace by "changeColumnPosition" - "moveColumnUp" and "moveColumnDown" are replaced by "changeColumnPosition"
- "moveSwimlaneUp" and "moveSwimlaneDown" are replace by "changeSwimlanePosition" - "moveSwimlaneUp" and "moveSwimlaneDown" are replaced by "changeSwimlanePosition"
New features: New features:

View File

@@ -211,7 +211,11 @@ class Request extends Base
*/ */
public function isHTTPS() 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';
} }
/** /**

View File

@@ -102,6 +102,12 @@ class RequestTest extends Base
$request = new Request($this->container, array('HTTPS' => '1'), array(), array(), array(), array()); $request = new Request($this->container, array('HTTPS' => '1'), array(), array(), array(), array());
$this->assertTrue($request->isHTTPS()); $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() public function testGetCookie()