From aeafd0579a7278dfbb09351d695db7ab1fe6d303 Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Thu, 25 Dec 2008 10:22:07 -0500 Subject: [PATCH] Twitter-bridge: fix for Twitter's new strict policy of rejecting HTTP POSTs with invalid "expect" headers darcs-hash:20081225152207-7b5ce-fe890baabaa8f0bf60b05f7558c1ece3544d9906.gz --- _darcs/inventory | 4 +- ...e890baabaa8f0bf60b05f7558c1ece3544d9906.gz | Bin 0 -> 335 bytes _darcs/pristine/lib/twitter.php | 6 +- _darcs/pristine/lib/util.php | 5 +- _darcs/tentative_pristine | 607 +----------------- lib/twitter.php | 6 +- lib/util.php | 5 +- 7 files changed, 33 insertions(+), 600 deletions(-) create mode 100644 _darcs/patches/20081225152207-7b5ce-fe890baabaa8f0bf60b05f7558c1ece3544d9906.gz diff --git a/_darcs/inventory b/_darcs/inventory index 347e0fb3fd..cd9e777114 100644 --- a/_darcs/inventory +++ b/_darcs/inventory @@ -92,4 +92,6 @@ Evan Prodromou **20081223194923 Another gigantor PEAR coding standards patch. Here, I've moved the opening curly bracket on a class statement to the following line. -] \ No newline at end of file +] +[Twitter-bridge: fix for Twitter's new strict policy of rejecting HTTP POSTs with invalid "expect" headers +Zach Copley **20081225152207] \ No newline at end of file diff --git a/_darcs/patches/20081225152207-7b5ce-fe890baabaa8f0bf60b05f7558c1ece3544d9906.gz b/_darcs/patches/20081225152207-7b5ce-fe890baabaa8f0bf60b05f7558c1ece3544d9906.gz new file mode 100644 index 0000000000000000000000000000000000000000..af4dca4fa9b0d10b2d2c2853a515b2d689cf3f42 GIT binary patch literal 335 zcmV-V0kHlbiwFP!000001FcbAPr@)1ec!LRnGYxm`#^#*N+h_5i3)-8qA{j)9lP4B zOVlN4r8b}Mgiluy_*Q?#ygf3RV+jU0050Pr1Ag& literal 0 HcmV?d00001 diff --git a/_darcs/pristine/lib/twitter.php b/_darcs/pristine/lib/twitter.php index 07871fb203..5eb15005a6 100644 --- a/_darcs/pristine/lib/twitter.php +++ b/_darcs/pristine/lib/twitter.php @@ -28,9 +28,11 @@ function get_twitter_data($uri, $screen_name, $password) CURLOPT_FAILONERROR => true, CURLOPT_HEADER => false, CURLOPT_FOLLOWLOCATION => true, - // CURLOPT_USERAGENT => "identi.ca", + # 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:') ); diff --git a/_darcs/pristine/lib/util.php b/_darcs/pristine/lib/util.php index 32201f2bed..fbe04c6c4a 100644 --- a/_darcs/pristine/lib/util.php +++ b/_darcs/pristine/lib/util.php @@ -1571,7 +1571,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); diff --git a/_darcs/tentative_pristine b/_darcs/tentative_pristine index 573c67a4fb..d5876c19c6 100644 --- a/_darcs/tentative_pristine +++ b/_darcs/tentative_pristine @@ -1,593 +1,14 @@ -hunk ./actions/accesstoken.php 24 --class AccesstokenAction extends Action { -+class AccesstokenAction extends Action -+{ -hunk ./actions/all.php 24 --class AllAction extends StreamAction { -+class AllAction extends StreamAction -+{ -hunk ./actions/allrss.php 26 --class AllrssAction extends Rss10Action { -+class AllrssAction extends Rss10Action -+{ -hunk ./actions/api.php 22 --class ApiAction extends Action { -+class ApiAction extends Action -+{ -hunk ./actions/avatarbynickname.php 22 --class AvatarbynicknameAction extends Action { -+class AvatarbynicknameAction extends Action -+{ -hunk ./actions/block.php 22 --class BlockAction extends Action { -+class BlockAction extends Action -+{ -hunk ./actions/confirmaddress.php 22 --class ConfirmaddressAction extends Action { -+class ConfirmaddressAction extends Action -+{ -hunk ./actions/deletenotice.php 24 --class DeletenoticeAction extends DeleteAction { -+class DeletenoticeAction extends DeleteAction -+{ -hunk ./actions/deleteprofile.php 22 --class DeleteprofileAction extends Action { -+class DeleteprofileAction extends Action -+{ -hunk ./actions/disfavor.php 22 --class DisfavorAction extends Action { -+class DisfavorAction extends Action -+{ -hunk ./actions/doc.php 22 --class DocAction extends Action { -+class DocAction extends Action -+{ -hunk ./actions/emailsettings.php 24 --class EmailsettingsAction extends SettingsAction { -+class EmailsettingsAction extends SettingsAction -+{ -hunk ./actions/facebookhome.php 24 --class FacebookhomeAction extends FacebookAction { -+class FacebookhomeAction extends FacebookAction -+{ -hunk ./actions/facebookinvite.php 24 --class FacebookinviteAction extends FacebookAction { -+class FacebookinviteAction extends FacebookAction -+{ -hunk ./actions/facebookremove.php 24 --class FacebookremoveAction extends FacebookAction { -+class FacebookremoveAction extends FacebookAction -+{ -hunk ./actions/facebooksettings.php 24 --class FacebooksettingsAction extends FacebookAction { -+class FacebooksettingsAction extends FacebookAction -+{ -hunk ./actions/favor.php 24 --class FavorAction extends Action { -+class FavorAction extends Action -+{ -hunk ./actions/favorited.php 24 --class FavoritedAction extends StreamAction { -+class FavoritedAction extends StreamAction -+{ -hunk ./actions/favoritesrss.php 26 --class FavoritesrssAction extends Rss10Action { -+class FavoritesrssAction extends Rss10Action -+{ -hunk ./actions/featured.php 25 --class FeaturedAction extends StreamAction { -+class FeaturedAction extends StreamAction -+{ -hunk ./actions/finishaddopenid.php 24 --class FinishaddopenidAction extends Action { -+class FinishaddopenidAction extends Action -+{ -hunk ./actions/finishimmediate.php 24 --class FinishimmediateAction extends Action { -+class FinishimmediateAction extends Action -+{ -hunk ./actions/finishopenidlogin.php 24 --class FinishopenidloginAction extends Action { -+class FinishopenidloginAction extends Action -+{ -hunk ./actions/finishremotesubscribe.php 24 --class FinishremotesubscribeAction extends Action { -+class FinishremotesubscribeAction extends Action -+{ -hunk ./actions/foaf.php 26 --class FoafAction extends Action { -+class FoafAction extends Action -+{ -hunk ./actions/imsettings.php 25 --class ImsettingsAction extends SettingsAction { -+class ImsettingsAction extends SettingsAction -+{ -hunk ./actions/invite.php 22 --class InviteAction extends Action { -+class InviteAction extends Action -+{ -hunk ./actions/login.php 22 --class LoginAction extends Action { -+class LoginAction extends Action -+{ -hunk ./actions/logout.php 24 --class LogoutAction extends Action { -+class LogoutAction extends Action -+{ -hunk ./actions/microsummary.php 22 --class MicrosummaryAction extends Action { -+class MicrosummaryAction extends Action -+{ -hunk ./actions/newmessage.php 22 --class NewmessageAction extends Action { -+class NewmessageAction extends Action -+{ -hunk ./actions/newnotice.php 24 --class NewnoticeAction extends Action { -+class NewnoticeAction extends Action -+{ -hunk ./actions/noticesearch.php 26 --class NoticesearchAction extends SearchAction { -+class NoticesearchAction extends SearchAction -+{ -hunk ./actions/noticesearchrss.php 26 --class NoticesearchrssAction extends Rss10Action { -+class NoticesearchrssAction extends Rss10Action -+{ -hunk ./actions/nudge.php 24 --class NudgeAction extends Action { -+class NudgeAction extends Action -+{ -hunk ./actions/openidlogin.php 24 --class OpenidloginAction extends Action { -+class OpenidloginAction extends Action -+{ -hunk ./actions/openidsettings.php 25 --class OpenidsettingsAction extends SettingsAction { -+class OpenidsettingsAction extends SettingsAction -+{ -hunk ./actions/opensearch.php 22 --class OpensearchAction extends Action { -+class OpensearchAction extends Action -+{ -hunk ./actions/othersettings.php 24 --class OthersettingsAction extends SettingsAction { -+class OthersettingsAction extends SettingsAction -+{ -hunk ./actions/peoplesearch.php 25 --class PeoplesearchAction extends SearchAction { -+class PeoplesearchAction extends SearchAction -+{ -hunk ./actions/peoplesearch.php 73 --class PeopleSearchResults extends ProfileList { -+class PeopleSearchResults extends ProfileList -+{ -hunk ./actions/peopletag.php 24 --class PeopletagAction extends Action { -+class PeopletagAction extends Action -+{ -hunk ./actions/postnotice.php 24 --class PostnoticeAction extends Action { -+class PostnoticeAction extends Action -+{ -hunk ./actions/profilesettings.php 24 --class ProfilesettingsAction extends SettingsAction { -+class ProfilesettingsAction extends SettingsAction -+{ -hunk ./actions/public.php 24 --class PublicAction extends StreamAction { -+class PublicAction extends StreamAction -+{ -hunk ./actions/publicrss.php 26 --class PublicrssAction extends Rss10Action { -+class PublicrssAction extends Rss10Action -+{ -hunk ./actions/publicxrds.php 26 --class PublicxrdsAction extends Action { -+class PublicxrdsAction extends Action -+{ -hunk ./actions/recoverpassword.php 26 --class RecoverpasswordAction extends Action { -+class RecoverpasswordAction extends Action -+{ -hunk ./actions/register.php 22 --class RegisterAction extends Action { -+class RegisterAction extends Action -+{ -hunk ./actions/remotesubscribe.php 24 --class RemotesubscribeAction extends Action { -+class RemotesubscribeAction extends Action -+{ -hunk ./actions/replies.php 24 --class RepliesAction extends StreamAction { -+class RepliesAction extends StreamAction -+{ -hunk ./actions/repliesrss.php 26 --class RepliesrssAction extends Rss10Action { -+class RepliesrssAction extends Rss10Action -+{ -hunk ./actions/requesttoken.php 24 --class RequesttokenAction extends Action { -+class RequesttokenAction extends Action -+{ -hunk ./actions/showfavorites.php 24 --class ShowfavoritesAction extends StreamAction { -+class ShowfavoritesAction extends StreamAction -+{ -hunk ./actions/showmessage.php 24 --class ShowmessageAction extends MailboxAction { -+class ShowmessageAction extends MailboxAction -+{ -hunk ./actions/shownotice.php 24 --class ShownoticeAction extends StreamAction { -+class ShownoticeAction extends StreamAction -+{ -hunk ./actions/showstream.php 27 --class ShowstreamAction extends StreamAction { -+class ShowstreamAction extends StreamAction -+{ -hunk ./actions/showstream.php 453 --class ProfileNoticeList extends NoticeList { -+class ProfileNoticeList extends NoticeList -+{ -hunk ./actions/showstream.php 461 --class ProfileNoticeListItem extends NoticeListItem { -+class ProfileNoticeListItem extends NoticeListItem -+{ -hunk ./actions/smssettings.php 25 --class SmssettingsAction extends EmailsettingsAction { -+class SmssettingsAction extends EmailsettingsAction -+{ -hunk ./actions/subedit.php 22 --class SubeditAction extends Action { -+class SubeditAction extends Action -+{ -hunk ./actions/subscribe.php 22 --class SubscribeAction extends Action { -+class SubscribeAction extends Action -+{ -hunk ./actions/subscribers.php 24 --class SubscribersAction extends GalleryAction { -+class SubscribersAction extends GalleryAction -+{ -hunk ./actions/subscribers.php 63 --class SubscribersList extends ProfileList { -+class SubscribersList extends ProfileList -+{ -hunk ./actions/subscriptions.php 24 --class SubscriptionsAction extends GalleryAction { -+class SubscriptionsAction extends GalleryAction -+{ -hunk ./actions/subscriptions.php 63 --class SubscriptionsList extends ProfileList { -+class SubscriptionsList extends ProfileList -+{ -hunk ./actions/sup.php 22 --class SupAction extends Action { -+class SupAction extends Action -+{ -hunk ./actions/tag.php 25 --class TagAction extends StreamAction { -+class TagAction extends StreamAction -+{ -hunk ./actions/tagother.php 24 --class TagotherAction extends Action { -+class TagotherAction extends Action -+{ -hunk ./actions/tagrss.php 26 --class TagrssAction extends Rss10Action { -+class TagrssAction extends Rss10Action -+{ -hunk ./actions/twitapiaccount.php 24 --class TwitapiaccountAction extends TwitterapiAction { -+class TwitapiaccountAction extends TwitterapiAction -+{ -hunk ./actions/twitapiblocks.php 24 --class TwitapiblocksAction extends TwitterapiAction { -+class TwitapiblocksAction extends TwitterapiAction -+{ -hunk ./actions/twitapidirect_messages.php 24 --class Twitapidirect_messagesAction extends TwitterapiAction { -+class Twitapidirect_messagesAction extends TwitterapiAction -+{ -hunk ./actions/twitapifavorites.php 24 --class TwitapifavoritesAction extends TwitterapiAction { -+class TwitapifavoritesAction extends TwitterapiAction -+{ -hunk ./actions/twitapifriendships.php 24 --class TwitapifriendshipsAction extends TwitterapiAction { -+class TwitapifriendshipsAction extends TwitterapiAction -+{ -hunk ./actions/twitapihelp.php 24 --class TwitapihelpAction extends TwitterapiAction { -+class TwitapihelpAction extends TwitterapiAction -+{ -hunk ./actions/twitapinotifications.php 25 --class TwitapinotificationsAction extends TwitterapiAction { -+class TwitapinotificationsAction extends TwitterapiAction -+{ -hunk ./actions/twitapistatuses.php 24 --class TwitapistatusesAction extends TwitterapiAction { -+class TwitapistatusesAction extends TwitterapiAction -+{ -hunk ./actions/twitapiusers.php 24 --class TwitapiusersAction extends TwitterapiAction { -+class TwitapiusersAction extends TwitterapiAction -+{ -hunk ./actions/twittersettings.php 26 --class TwittersettingsAction extends SettingsAction { -+class TwittersettingsAction extends SettingsAction -+{ -hunk ./actions/unblock.php 22 --class UnblockAction extends Action { -+class UnblockAction extends Action -+{ -hunk ./actions/unsubscribe.php 20 --class UnsubscribeAction extends Action { -+class UnsubscribeAction extends Action -+{ -hunk ./actions/updateprofile.php 24 --class UpdateprofileAction extends Action { -+class UpdateprofileAction extends Action -+{ -hunk ./actions/userauthorization.php 25 --class UserauthorizationAction extends Action { -+class UserauthorizationAction extends Action -+{ -hunk ./actions/userbyid.php 22 --class UserbyidAction extends Action { -+class UserbyidAction extends Action -+{ -hunk ./actions/userrss.php 26 --class UserrssAction extends Rss10Action { -+class UserrssAction extends Rss10Action -+{ -hunk ./actions/xrds.php 24 --class XrdsAction extends Action { -+class XrdsAction extends Action -+{ -hunk ./classes/Channel.php 22 --class Channel { -+class Channel -+{ -hunk ./classes/Channel.php 51 --class XMPPChannel extends Channel { -+class XMPPChannel extends Channel -+{ -hunk ./classes/Channel.php 109 --class WebChannel extends Channel { -+class WebChannel extends Channel -+{ -hunk ./classes/Channel.php 144 --class AjaxWebChannel extends WebChannel { -+class AjaxWebChannel extends WebChannel -+{ -hunk ./classes/Channel.php 173 --class MailChannel extends Channel { -+class MailChannel extends Channel -+{ -hunk ./classes/Command.php 24 --class Command { -+class Command -+{ -hunk ./classes/Command.php 40 --class UnimplementedCommand extends Command { -+class UnimplementedCommand extends Command -+{ -hunk ./classes/Command.php 48 --class TrackingCommand extends UnimplementedCommand { -+class TrackingCommand extends UnimplementedCommand -+{ -hunk ./classes/Command.php 52 --class TrackOffCommand extends UnimplementedCommand { -+class TrackOffCommand extends UnimplementedCommand -+{ -hunk ./classes/Command.php 56 --class TrackCommand extends UnimplementedCommand { -+class TrackCommand extends UnimplementedCommand -+{ -hunk ./classes/Command.php 66 --class UntrackCommand extends UnimplementedCommand { -+class UntrackCommand extends UnimplementedCommand -+{ -hunk ./classes/Command.php 76 --class NudgeCommand extends UnimplementedCommand { -+class NudgeCommand extends UnimplementedCommand -+{ -hunk ./classes/Command.php 86 --class InviteCommand extends UnimplementedCommand { -+class InviteCommand extends UnimplementedCommand -+{ -hunk ./classes/Command.php 96 --class StatsCommand extends Command { -+class StatsCommand extends Command -+{ -hunk ./classes/Command.php 122 --class FavCommand extends Command { -+class FavCommand extends Command -+{ -hunk ./classes/Command.php 170 --class WhoisCommand extends Command { -+class WhoisCommand extends Command -+{ -hunk ./classes/Command.php 207 --class MessageCommand extends Command { -+class MessageCommand extends Command -+{ -hunk ./classes/Command.php 252 --class GetCommand extends Command { -+class GetCommand extends Command -+{ -hunk ./classes/Command.php 285 --class SubCommand extends Command { -+class SubCommand extends Command -+{ -hunk ./classes/Command.php 314 --class UnsubCommand extends Command { -+class UnsubCommand extends Command -+{ -hunk ./classes/Command.php 342 --class OffCommand extends Command { -+class OffCommand extends Command -+{ -hunk ./classes/Command.php 364 --class OnCommand extends Command { -+class OnCommand extends Command -+{ -hunk ./classes/Command.php 387 --class HelpCommand extends Command { -+class HelpCommand extends Command -+{ -hunk ./classes/CommandInterpreter.php 24 --class CommandInterpreter { -+class CommandInterpreter -+{ -hunk ./classes/NoticeWrapper.php 24 --class NoticeWrapper extends Notice { -+class NoticeWrapper extends Notice -+{ -hunk ./lib/Shorturl_api.php 22 --class ShortUrlApi { -+class ShortUrlApi -+{ -hunk ./lib/Shorturl_api.php 73 --class LilUrl extends ShortUrlApi { -+class LilUrl extends ShortUrlApi -+{ -hunk ./lib/Shorturl_api.php 93 --class PtitUrl extends ShortUrlApi { -+class PtitUrl extends ShortUrlApi -+{ -hunk ./lib/Shorturl_api.php 112 --class TightUrl extends ShortUrlApi { -+class TightUrl extends ShortUrlApi -+{ -hunk ./lib/deleteaction.php 22 --class DeleteAction extends Action { -+class DeleteAction extends Action -+{ -hunk ./lib/facebookaction.php 24 --class FacebookAction extends Action { -+class FacebookAction extends Action -+{ -hunk ./lib/oauthstore.php 24 --class LaconicaOAuthDataStore extends OAuthDataStore { -+class LaconicaOAuthDataStore extends OAuthDataStore -+{ -hunk ./lib/oauthstore.php 27 -- # We keep a record of who's contacted us -+ // We keep a record of who's contacted us -hunk ./lib/oauthstore.php 79 -- $t->type = 0; # request -- $t->state = 0; # unauthorized -+ $t->type = 0; // request -+ $t->state = 0; // unauthorized -hunk ./lib/oauthstore.php 89 -- # defined in OAuthDataStore, but not implemented anywhere -+ // defined in OAuthDataStore, but not implemented anywhere -hunk ./lib/oauthstore.php 102 -- $rt->type = 0; # request -- if ($rt->find(true) && $rt->state == 1) { # authorized -+ $rt->type = 0; // request -+ if ($rt->find(true) && $rt->state == 1) { // authorized -hunk ./lib/oauthstore.php 109 -- $at->type = 1; # access -+ $at->type = 1; // access -hunk ./lib/oauthstore.php 117 -- # burn the old one -+ // burn the old one -hunk ./lib/oauthstore.php 119 -- $rt->state = 2; # used -+ $rt->state = 2; // used -hunk ./lib/oauthstore.php 124 -- # Update subscription -- # XXX: mixing levels here -+ // Update subscription -+ // XXX: mixing levels here -hunk ./lib/oauthstore.php 146 -- # defined in OAuthDataStore, but not implemented anywhere -+ // defined in OAuthDataStore, but not implemented anywhere -hunk ./lib/personal.php 22 --class PersonalAction extends Action { -+class PersonalAction extends Action -+{ -hunk ./lib/profilelist.php 25 --class ProfileList { -+class ProfileList -+{ -hunk ./lib/queuehandler.php 28 --class QueueHandler extends Daemon { -+class QueueHandler extends Daemon -+{ -hunk ./lib/rssaction.php 24 --class Rss10Action extends Action { -+class Rss10Action extends Action -+{ -hunk ./lib/search_engines.php 22 --class SearchEngine { -+class SearchEngine -+{ -hunk ./lib/search_engines.php 49 --class SphinxSearch extends SearchEngine { -+class SphinxSearch extends SearchEngine -+{ -hunk ./lib/search_engines.php 108 --class MySQLSearch extends SearchEngine { -+class MySQLSearch extends SearchEngine -+{ -hunk ./lib/search_engines.php 121 --class PGSearch extends SearchEngine { -+class PGSearch extends SearchEngine -+{ -hunk ./lib/searchaction.php 22 --class SearchAction extends Action { -+class SearchAction extends Action -+{ -hunk ./lib/settingsaction.php 22 --class SettingsAction extends Action { -+class SettingsAction extends Action -+{ -hunk ./lib/stream.php 25 --class StreamAction extends PersonalAction { -+class StreamAction extends PersonalAction -+{ -hunk ./lib/twitterapi.php 22 --class TwitterapiAction extends Action { -+class TwitterapiAction extends Action -+{ -hunk ./lib/xmppqueuehandler.php 31 --class XmppQueueHandler extends QueueHandler { -+class XmppQueueHandler extends QueueHandler -+{ -hunk ./scripts/enjitqueuehandler.php 36 --class EnjitQueueHandler extends QueueHandler { -+class EnjitQueueHandler extends QueueHandler -+{ -hunk ./scripts/jabberqueuehandler.php 36 --class JabberQueueHandler extends XmppQueueHandler { -+class JabberQueueHandler extends XmppQueueHandler -+{ -hunk ./scripts/maildaemon.php 37 --class MailerDaemon { -+class MailerDaemon -+{ -hunk ./scripts/ombqueuehandler.php 36 --class OmbQueueHandler extends QueueHandler { -+class OmbQueueHandler extends QueueHandler -+{ -hunk ./scripts/publicqueuehandler.php 36 --class PublicQueueHandler extends XmppQueueHandler { -+class PublicQueueHandler extends XmppQueueHandler -+{ -hunk ./scripts/smsqueuehandler.php 36 --class SmsQueueHandler extends QueueHandler { -+class SmsQueueHandler extends QueueHandler -+{ -hunk ./scripts/xmppconfirmhandler.php 38 --class XmppConfirmHandler extends XmppQueueHandler { -+class XmppConfirmHandler extends XmppQueueHandler -+{ -hunk ./scripts/xmppdaemon.php 40 --class XMPPDaemon extends Daemon { -+class XMPPDaemon extends Daemon -+{ +hunk ./lib/twitter.php 31 +- // CURLOPT_USERAGENT => "identi.ca", ++ # CURLOPT_USERAGENT => "identi.ca", +hunk ./lib/twitter.php 33 +- CURLOPT_TIMEOUT => 120 ++ CURLOPT_TIMEOUT => 120, ++ # Twitter is strict about accepting invalid "Expect" headers ++ CURLOPT_HTTPHEADER => array('Expect:') +hunk ./lib/util.php 1574 +- CURLOPT_TIMEOUT => 120 ++ CURLOPT_TIMEOUT => 120, ++ ++ # Twitter is strict about accepting invalid "Expect" headers ++ CURLOPT_HTTPHEADER => array('Expect:') diff --git a/lib/twitter.php b/lib/twitter.php index 07871fb203..5eb15005a6 100644 --- a/lib/twitter.php +++ b/lib/twitter.php @@ -28,9 +28,11 @@ function get_twitter_data($uri, $screen_name, $password) CURLOPT_FAILONERROR => true, CURLOPT_HEADER => false, CURLOPT_FOLLOWLOCATION => true, - // CURLOPT_USERAGENT => "identi.ca", + # 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:') ); diff --git a/lib/util.php b/lib/util.php index 32201f2bed..fbe04c6c4a 100644 --- a/lib/util.php +++ b/lib/util.php @@ -1571,7 +1571,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);