Permalink
Browse files

Merge pull request #13 from tuo/master

Fix: Incorrect signature base string when parameters contains ampersand
  • Loading branch information...
2 parents e4db8d1 + fee1496 commit 6ed6ed22ef295c6078685189ebe1ce2184dba09d @rsieiro committed Nov 14, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 RSOAuthEngine/RSOAuthEngine.m
@@ -202,11 +202,11 @@ - (NSString *)signatureBaseStringForRequest:(MKNetworkOperation *)request
// Only include GET and POST fields if there are no files or data to be posted
if ([request.filesToBePosted count] == 0 && [request.dataToBePosted count] == 0) {
// Add parameters from the query string
- NSArray *pairs = [[url.query urlDecodedString] componentsSeparatedByString:@"&"];
+ NSArray *pairs = [url.query componentsSeparatedByString:@"&"];
[pairs enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
NSArray *elements = [obj componentsSeparatedByString:@"="];
- NSString *key = [[elements objectAtIndex:0] urlEncodedString];
- NSString *value = (elements.count > 1) ? [[elements objectAtIndex:1] urlEncodedString] : @"";
+ NSString *key = [elements objectAtIndex:0];
+ NSString *value = (elements.count > 1) ? [elements objectAtIndex:1] : @"";
[parameters addObject:[NSDictionary dictionaryWithObjectsAndKeys:key, @"key", value, @"value", nil]];
}];

0 comments on commit 6ed6ed2

Please sign in to comment.