mirror of
https://github.com/getgrav/grav.git
synced 2026-07-07 17:32:02 +02:00
Re-added SSL off-loading that was lost with Grav v1.4.0 merge #1888
This commit is contained in:
@@ -1,3 +1,10 @@
|
||||
# v1.4.6
|
||||
## mm/dd/2018
|
||||
|
||||
1. [](#improved)
|
||||
* Manually re-added the improved SSL off-loading that was lost with Grav v1.4.0 merge [#1888](https://github.com/getgrav/grav/pull/1888)
|
||||
|
||||
|
||||
# v1.4.5
|
||||
## 05/15/2018
|
||||
|
||||
|
||||
@@ -1119,8 +1119,12 @@ class Uri
|
||||
protected function createFromEnvironment(array $env)
|
||||
{
|
||||
// Build scheme.
|
||||
if (isset($env['REQUEST_SCHEME'])) {
|
||||
$this->scheme = $env['REQUEST_SCHEME'];
|
||||
if (isset($env['HTTP_X_FORWARDED_PROTO'])) {
|
||||
$this->scheme = $env['HTTP_X_FORWARDED_PROTO'];
|
||||
} elseif (isset($env['X-FORWARDED-PROTO'])) {
|
||||
$this->scheme = $env['X-FORWARDED-PROTO'];
|
||||
} elseif (isset($env['REQUEST_SCHEME'])) {
|
||||
$this->scheme = $env['REQUEST_SCHEME'];
|
||||
} else {
|
||||
$https = isset($env['HTTPS']) ? $env['HTTPS'] : '';
|
||||
$this->scheme = (empty($https) || strtolower($https) === 'off') ? 'http' : 'https';
|
||||
@@ -1143,7 +1147,16 @@ class Uri
|
||||
$this->host = $this->validateHostname($hostname) ? $hostname : 'unknown';
|
||||
|
||||
// Build port.
|
||||
$this->port = isset($env['SERVER_PORT']) ? (int)$env['SERVER_PORT'] : null;
|
||||
if (isset($env['HTTP_X_FORWARDED_PORT'])) {
|
||||
$this->port = (int)$env['HTTP_X_FORWARDED_PORT'];
|
||||
} elseif (isset($env['X-FORWARDED-PORT'])) {
|
||||
$this->port = (int)$env['X-FORWARDED-PORT'];
|
||||
} elseif (isset($env['SERVER_PORT'])) {
|
||||
$this->port = (int)$env['SERVER_PORT'];
|
||||
} else {
|
||||
$this->port = null;
|
||||
}
|
||||
|
||||
if ($this->hasStandardPort()) {
|
||||
$this->port = null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user