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'] ?? ''); } /**