aboutsummaryrefslogtreecommitdiffhomepage
path: root/application/HttpUtils.php
diff options
context:
space:
mode:
Diffstat (limited to 'application/HttpUtils.php')
-rw-r--r--application/HttpUtils.php9
1 files changed, 8 insertions, 1 deletions
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
82 } 82 }
83 83
84 // Max download size management 84 // Max download size management
85 curl_setopt($ch, CURLOPT_BUFFERSIZE, 1024); 85 curl_setopt($ch, CURLOPT_BUFFERSIZE, 1024*16);
86 curl_setopt($ch, CURLOPT_NOPROGRESS, false); 86 curl_setopt($ch, CURLOPT_NOPROGRESS, false);
87 curl_setopt($ch, CURLOPT_PROGRESSFUNCTION, 87 curl_setopt($ch, CURLOPT_PROGRESSFUNCTION,
88 function($arg0, $arg1, $arg2, $arg3, $arg4 = 0) use ($maxBytes) 88 function($arg0, $arg1, $arg2, $arg3, $arg4 = 0) use ($maxBytes)
@@ -308,6 +308,13 @@ function server_url($server)
308 $port = $server['HTTP_X_FORWARDED_PORT']; 308 $port = $server['HTTP_X_FORWARDED_PORT'];
309 } 309 }
310 310
311 // This is a workaround for proxies that don't forward the scheme properly.
312 // Connecting over port 443 has to be in HTTPS.
313 // See https://github.com/shaarli/Shaarli/issues/1022
314 if ($port == '443') {
315 $scheme = 'https';
316 }
317
311 if (($scheme == 'http' && $port != '80') 318 if (($scheme == 'http' && $port != '80')
312 || ($scheme == 'https' && $port != '443') 319 || ($scheme == 'https' && $port != '443')
313 ) { 320 ) {