Fixed ERR_TOO_MANY_REDIRECTS with HTTPS = 'On' [#3155]

This commit is contained in:
Matias Griese
2021-01-18 20:38:58 +02:00
parent 15464aa10c
commit af2f4b66b9
2 changed files with 3 additions and 1 deletions

View File

@@ -31,6 +31,7 @@
* Fixed multiple issues with `system.language.translations: false`
* Fixed page collections containing dummy items for untranslated default language [#2985](https://github.com/getgrav/grav/issues/2985)
* Fixed streams in `setup.php` being overridden by `system/streams.yaml` [#2450](https://github.com/getgrav/grav/issues/2450)
* Fixed `ERR_TOO_MANY_REDIRECTS` with HTTPS = 'On' [#3155](https://github.com/getgrav/grav/issues/3155)
# v1.7.0-rc.20
## 12/15/2020

View File

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