From 156c5849c7f2f7f60f5e3911f598c360fd6a09b2 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Sat, 9 Mar 2019 16:16:07 +0100 Subject: [PATCH] Fix current uri scheme --- Uri/Http.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Uri/Http.php b/Uri/Http.php index fa20e28ba..4c0c5f4c0 100644 --- a/Uri/Http.php +++ b/Uri/Http.php @@ -187,7 +187,7 @@ final class Http implements UriInterface public static function getCurrent() : string { /** @noinspection PhpUndefinedConstantInspection */ - return 'http://' . ($_SERVER['HTTP_HOST'] ?? '') . ($_SERVER['REQUEST_URI'] ?? ''); + return (\stripos($_SERVER['SERVER_PROTOCOL'], 'https') !== false ? 'https' : 'http' ) . '://' . ($_SERVER['HTTP_HOST'] ?? '') . ($_SERVER['REQUEST_URI'] ?? ''); } /**