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

@@ -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';
}
/**