Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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...
commit fee14965ce507675bcb7842fdee5a8e5c2b3c80b 1 parent e4db8d1
tu0huang tuo authored

Showing 1 changed file with 3 additions and 3 deletions. Show diff stats Hide diff stats

  1. +3 3 RSOAuthEngine/RSOAuthEngine.m
6 RSOAuthEngine/RSOAuthEngine.m
@@ -202,11 +202,11 @@ - (NSString *)signatureBaseStringForRequest:(MKNetworkOperation *)request
202 202 // Only include GET and POST fields if there are no files or data to be posted
203 203 if ([request.filesToBePosted count] == 0 && [request.dataToBePosted count] == 0) {
204 204 // Add parameters from the query string
205   - NSArray *pairs = [[url.query urlDecodedString] componentsSeparatedByString:@"&"];
  205 + NSArray *pairs = [url.query componentsSeparatedByString:@"&"];
206 206 [pairs enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
207 207 NSArray *elements = [obj componentsSeparatedByString:@"="];
208   - NSString *key = [[elements objectAtIndex:0] urlEncodedString];
209   - NSString *value = (elements.count > 1) ? [[elements objectAtIndex:1] urlEncodedString] : @"";
  208 + NSString *key = [elements objectAtIndex:0];
  209 + NSString *value = (elements.count > 1) ? [elements objectAtIndex:1] : @"";
210 210
211 211 [parameters addObject:[NSDictionary dictionaryWithObjectsAndKeys:key, @"key", value, @"value", nil]];
212 212 }];

0 comments on commit fee1496

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