Skip to content
Browse files

Check if the POST body is a NSString. Fixes #8

Values from the POST body should only be added to the OAuth
signature string if they are instances of NSString.
  • Loading branch information...
1 parent 2828d92 commit bd042fc52de5e0c17ef397b7b0f9ad3ec2fc99c1 @rsieiro committed Jun 8, 2012
Showing with 8 additions and 1 deletion.
  1. +8 −1 RSOAuthEngine/RSOAuthEngine.m
View
9 RSOAuthEngine/RSOAuthEngine.m
@@ -161,7 +161,14 @@ - (NSString *)signatureBaseStringForRequest:(MKNetworkOperation *)request signOn
// Only if we're POSTing, GET parameters were already added
if (!onlyOAuth && [[[request HTTPMethod] uppercaseString] isEqualToString:@"POST"]) {
[request.readonlyPostDictionary enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) {
- [parameters addObject:[NSDictionary dictionaryWithObjectsAndKeys:[key urlEncodedString], @"key", [obj urlEncodedString], @"value", nil]];
+ if ([key isKindOfClass:[NSString class]] && [obj isKindOfClass:[NSString class]]) {
+ [parameters addObject:[NSDictionary dictionaryWithObjectsAndKeys:
+ [key urlEncodedString],
+ @"key",
+ [obj urlEncodedString],
+ @"value",
+ nil]];
+ }
}];
}

0 comments on commit bd042fc

Please sign in to comment.
Something went wrong with that request. Please try again.