Permalink
Browse files

Fix: Incorrect signature base string when parameters contains ampersand.

As if query parameter contains ampersand, right now it decode it and separate by ampersand, which causes problem like invalid oauth signatures
  • Loading branch information...
1 parent e4db8d1 commit fee14965ce507675bcb7842fdee5a8e5c2b3c80b @tuo tuo committed Nov 13, 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 fee1496

Please sign in to comment.