X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=application%2FHttpUtils.php;h=c6181df44d3938842067f02d589b9253839b2f3e;hb=8e9fc6f6e6afc052a2c3b2d459764cc9ab20420a;hp=0083596643f510d4ea131fad9df25de215ff77ac;hpb=844be5d55610f21e078f3325a1e4e20f41e5abb5;p=github%2Fshaarli%2FShaarli.git diff --git a/application/HttpUtils.php b/application/HttpUtils.php index 00835966..c6181df4 100644 --- a/application/HttpUtils.php +++ b/application/HttpUtils.php @@ -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') ) {