Fix force_ssl redirect in case of undefined hostname (#3702)

This commit is contained in:
Vilius Šumskas
2023-03-17 16:53:45 +02:00
committed by GitHub
parent 940415dddb
commit c261d0d3f7

View File

@@ -72,7 +72,7 @@ class PagesServiceProvider implements ServiceProviderInterface
if ($config->get('system.force_ssl')) {
$scheme = $uri->scheme(true);
if ($scheme !== 'https') {
$url = 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
$url = 'https://' . $uri->host() . $uri->uri();
$grav->redirect($url);
}
}