X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=application%2FHttpUtils.php;fp=application%2FHttpUtils.php;h=83a4c5e28699eff2472e4b7c132cef1e8bc53e8b;hb=d449f79a0d7ca808b891baf73b9e25ce7f7e48fe;hp=2edf5ce2df74bcb39fd5a1ce15c401302ff666c1;hpb=d65342e304f92643ba922200953cfebc51e1e482;p=github%2Fshaarli%2FShaarli.git diff --git a/application/HttpUtils.php b/application/HttpUtils.php index 2edf5ce2..83a4c5e2 100644 --- a/application/HttpUtils.php +++ b/application/HttpUtils.php @@ -82,7 +82,7 @@ function get_http_response($url, $timeout = 30, $maxBytes = 4194304, $curlWriteF } // Max download size management - curl_setopt($ch, CURLOPT_BUFFERSIZE, 1024); + curl_setopt($ch, CURLOPT_BUFFERSIZE, 1024*16); curl_setopt($ch, CURLOPT_NOPROGRESS, false); curl_setopt($ch, CURLOPT_PROGRESSFUNCTION, function($arg0, $arg1, $arg2, $arg3, $arg4 = 0) use ($maxBytes) @@ -308,6 +308,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') ) {