Permalink
Browse files

Consideration of the case that contains the port number in the URL

  • Loading branch information...
1 parent 152905a commit 3c31655386724ef87fa64e02d73eb463aed3f6e8 Taku Yamada committed Nov 8, 2012
Showing with 6 additions and 1 deletion.
  1. +6 −1 OAuthCore.m
View
@@ -73,7 +73,12 @@ static NSInteger SortParameter(NSString *key1, NSString *key2, void *context) {
}
NSString *normalizedParameterString = [parameterArray componentsJoinedByString:@"&"];
- NSString *normalizedURLString = [NSString stringWithFormat:@"%@://%@%@", [url scheme], [url host], [url path]];
+ NSString *normalizedURLString;
+ if ([url port] == nil) {
+ normalizedURLString = [NSString stringWithFormat:@"%@://%@%@", [url scheme], [url host], [url path]];
+ } else {
+ normalizedURLString = [NSString stringWithFormat:@"%@://%@:%@%@", [url scheme], [url host], [url port], [url path]];
+ }
NSString *signatureBaseString = [NSString stringWithFormat:@"%@&%@&%@",
[method ab_RFC3986EncodedString],

0 comments on commit 3c31655

Please sign in to comment.