From 80f58b9d2478a1995c71255587e768909f5081db Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Sat, 9 Mar 2019 16:26:18 +0100 Subject: [PATCH] Fix base scheme --- Uri/Http.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Uri/Http.php b/Uri/Http.php index 4c0c5f4c0..2168495e6 100644 --- a/Uri/Http.php +++ b/Uri/Http.php @@ -187,7 +187,10 @@ final class Http implements UriInterface public static function getCurrent() : string { /** @noinspection PhpUndefinedConstantInspection */ - return (\stripos($_SERVER['SERVER_PROTOCOL'], 'https') !== false ? 'https' : 'http' ) . '://' . ($_SERVER['HTTP_HOST'] ?? '') . ($_SERVER['REQUEST_URI'] ?? ''); + return ((!empty($_SERVER['HTTPS'] ?? '') && ($_SERVER['HTTPS'] ?? '') !== 'off') + || (($_SERVER['HTTP_X_FORWARDED_PROTO'] ?? '') === 'https') + || (($_SERVER['HTTP_X_FORWARDED_SSL'] ?? '') === 'on')) + . '://' . ($_SERVER['HTTP_HOST'] ?? ''). ($_SERVER['REQUEST_URI'] ?? ''); } /**