]> git.mxchange.org Git - friendica.git/commitdiff
require 'Expect' http-header for non-apache webserver (like lighttpd)
authoraweiher <dem_ist@nurfuerspam.de>
Mon, 4 Jul 2011 15:22:47 +0000 (17:22 +0200)
committeraweiher <dem_ist@nurfuerspam.de>
Mon, 4 Jul 2011 15:22:47 +0000 (17:22 +0200)
boot.php

index 855a67dfd2b020695daef36e6c6cddbb1bf98d7c..73e16f7e897b9c0bcaf372e44a2a17bfee9cb4ff 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -756,8 +756,15 @@ function post_url($url,$params, $headers = null, &$redirects = 0) {
        $curl_time = intval(get_config('system','curl_timeout'));
        curl_setopt($ch, CURLOPT_TIMEOUT, (($curl_time !== false) ? $curl_time : 60));
 
-       if(is_array($headers))
-               curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
+       if(!is_array($headers)) {
+               $headers = array('Expect:');
+       } else {
+               if(!in_array('Expect:', $headers)) {
+                       array_push($headers, 'Expect:');
+               }
+       }
+
+       curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
 
        $check_cert = get_config('system','verifyssl');
        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, (($check_cert) ? true : false));