Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #5 from socialize/allow-trailing-slash

Preserve trailing slash in signature base
  • Loading branch information...
commit 08727c23ae3ce27f9ec2c008d0bc1fbcc0ada20b 2 parents e40e2d0 + 0bf20a9
@atebits authored
Showing with 9 additions and 2 deletions.
  1. +1 −0  OAuth+Additions.h
  2. +6 −0 OAuth+Additions.m
  3. +2 −2 OAuthCore.m
View
1  OAuth+Additions.h
@@ -10,6 +10,7 @@
@interface NSURL (OAuthAdditions)
+ (NSDictionary *)ab_parseURLQueryString:(NSString *)query;
+- (NSString *)ab_actualPath;
@end
View
6 OAuth+Additions.m
@@ -26,6 +26,12 @@ + (NSDictionary *)ab_parseURLQueryString:(NSString *)query
return [NSDictionary dictionaryWithDictionary:dict];
}
+- (NSString *)ab_actualPath
+{
+ NSString* cfPath = [(NSString*)CFURLCopyPath((CFURLRef)self) autorelease];
+ return cfPath;
+}
+
@end
@implementation NSString (OAuthAdditions)
View
4 OAuthCore.m
@@ -80,9 +80,9 @@ static NSInteger SortParameter(NSString *key1, NSString *key2, void *context) {
NSString *normalizedURLString;
if([url port] == nil) {
- normalizedURLString = [NSString stringWithFormat:@"%@://%@%@", [url scheme], [url host], [url path]];
+ normalizedURLString = [NSString stringWithFormat:@"%@://%@%@", [url scheme], [url host], [url ab_actualPath]];
} else {
- normalizedURLString = [NSString stringWithFormat:@"%@://%@:%@%@", [url scheme], [url host], [url port], [url path]];
+ normalizedURLString = [NSString stringWithFormat:@"%@://%@:%@%@", [url scheme], [url host], [url port], [url ab_actualPath]];
}
NSString *signatureBaseString = [NSString stringWithFormat:@"%@&%@&%@",

0 comments on commit 08727c2

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