]> git.immae.eu Git - github/shaarli/Shaarli.git/blobdiff - application/HttpUtils.php
Merge pull request #1025 from ArthurHoaro/hotfix/proxy-443
[github/shaarli/Shaarli.git] / application / HttpUtils.php
index ec54dcd4faa78a92bd3fb6533b7c4f9a6b608776..c9371b55c5cc6ddacd9a888984889a466075b63a 100644 (file)
@@ -302,6 +302,13 @@ function server_url($server)
                 $port = $server['HTTP_X_FORWARDED_PORT'];
             }
 
+            // This is a workaround for proxies that don't forward the scheme properly.
+            // Connecting over port 443 has to be in HTTPS.
+            // See https://github.com/shaarli/Shaarli/issues/1022
+            if ($port == '443') {
+                $scheme = 'https';
+            }
+
             if (($scheme == 'http' && $port != '80')
                 || ($scheme == 'https' && $port != '443')
             ) {