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

Merged
merged 1 commit into from Nov 8, 2012
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],