]> git.mxchange.org Git - friendica.git/commitdiff
Add support for reverse proxy to system.force_ssl feature
authorHypolite Petovan <hypolite@mrpetovan.com>
Wed, 24 May 2023 12:04:34 +0000 (08:04 -0400)
committerHypolite Petovan <hypolite@mrpetovan.com>
Wed, 24 May 2023 12:04:34 +0000 (08:04 -0400)
src/App.php

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