]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Twitter-bridge: fix for Twitter's new strict policy of rejecting HTTP POSTs with...
authorZach Copley <zach@controlyourself.ca>
Fri, 26 Dec 2008 05:17:16 +0000 (00:17 -0500)
committerZach Copley <zach@controlyourself.ca>
Fri, 26 Dec 2008 05:17:16 +0000 (00:17 -0500)
darcs-hash:20081226051716-7b5ce-82040320785bab9438aa11cf5efa63fa4cba10ae.gz

lib/twitter.php
lib/util.php

index 5c9ef5d6f540e40107d4715270b2f4bf368f5c43..7f75a1afd87d00050c9f17997363ae4e827fddfa 100644 (file)
@@ -29,7 +29,10 @@ function get_twitter_data($uri, $screen_name, $password) {
                        CURLOPT_FOLLOWLOCATION  => true,
                        // CURLOPT_USERAGENT            => "identi.ca",
                        CURLOPT_CONNECTTIMEOUT  => 120,
-                       CURLOPT_TIMEOUT                 => 120
+            CURLOPT_TIMEOUT            => 120,
+            
+            # Twitter is strict about accepting invalid "Expect" headers
+            CURLOPT_HTTPHEADER => array('Expect:')
        );
 
 
index 8eeda11156b164bb0c2184ea89b8832b01ab6d76..7518fbf5595edc5636e0a45764564a18e2f21627 100644 (file)
@@ -1498,7 +1498,10 @@ function common_twitter_broadcast($notice, $flink) {
                CURLOPT_FOLLOWLOCATION  => true,
                CURLOPT_USERAGENT               => "Laconica",
                CURLOPT_CONNECTTIMEOUT  => 120,  // XXX: Scary!!!! How long should this be?
-               CURLOPT_TIMEOUT                 => 120
+        CURLOPT_TIMEOUT            => 120,
+        
+        # Twitter is strict about accepting invalid "Expect" headers
+        CURLOPT_HTTPHEADER => array('Expect:')
        );
 
        $ch = curl_init($uri);