Fix current uri scheme

This commit is contained in:
Dennis Eichhorn 2019-03-09 16:16:07 +01:00
parent 1e79d9616a
commit 156c5849c7

View File

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