X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=application%2FHttpUtils.php;h=c9371b55c5cc6ddacd9a888984889a466075b63a;hb=fdb4fee4330067f13ff8ee15e3222ee2736e7bc1;hp=ec54dcd4faa78a92bd3fb6533b7c4f9a6b608776;hpb=91c807d2755ac65ec7b06560f25ca3c6ed4a8417;p=github%2Fshaarli%2FShaarli.git diff --git a/application/HttpUtils.php b/application/HttpUtils.php index ec54dcd4..c9371b55 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') ) {