Merge pull request #13163 from MrPetovan/bug/13129-force-ssl-reverse-proxy

Add support for reverse proxy to system.force_ssl feature
This commit is contained in:
Tobias Diekershoff 2023-05-24 18:36:17 +02:00 committed by GitHub
commit f98cb3a5df
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -581,6 +581,7 @@ class App
// Force SSL redirection // Force SSL redirection
if ($this->config->get('system', 'force_ssl') && if ($this->config->get('system', 'force_ssl') &&
(empty($server['HTTPS']) || $server['HTTPS'] === 'off') && (empty($server['HTTPS']) || $server['HTTPS'] === 'off') &&
(empty($server['HTTP_X_FORWARDED_PROTO']) || $server['HTTP_X_FORWARDED_PROTO'] === 'http') &&
!empty($server['REQUEST_METHOD']) && !empty($server['REQUEST_METHOD']) &&
$server['REQUEST_METHOD'] === 'GET') { $server['REQUEST_METHOD'] === 'GET') {
System::externalRedirect($this->baseURL . '/' . $this->args->getQueryString()); System::externalRedirect($this->baseURL . '/' . $this->args->getQueryString());