Browse files

Forced the update request to use SSL

This is related to a Twitter bug - see the comments above the call in code.
  • Loading branch information...
1 parent 8be7363 commit c349c1e8e055cfd2c9e59e9e1c1efc34d1b55108 @rsieiro committed Dec 19, 2011
Showing with 6 additions and 2 deletions.
  1. +6 −2 TwitterDemo/Twitter/RSTwitterEngine.m
View
8 TwitterDemo/Twitter/RSTwitterEngine.m
@@ -276,10 +276,14 @@ - (void)sendTweet:(NSString *)tweet withCompletionBlock:(RSTwitterEngineCompleti
NSMutableDictionary *postParams = [NSMutableDictionary dictionaryWithObjectsAndKeys:
tweet, @"status",
nil];
-
+
+ // If the user marks the option "HTTPS Only" in his/her profile,
+ // Twitter will fail all non-auth requests that use only HTTP
+ // with a misleading "OAuth error". I guess it's a bug.
MKNetworkOperation *op = [self operationWithPath:TW_STATUS_UPDATE
params:postParams
- httpMethod:@"POST"];
+ httpMethod:@"POST"
+ ssl:YES];
[op onCompletion:^(MKNetworkOperation *completedOperation) {
completionBlock(nil);

0 comments on commit c349c1e

Please sign in to comment.