Permalink
Browse files

Cleanup formatting

  • Loading branch information...
1 parent 72262d4 commit e40e2d0ee1b58dbbdadea03a93e595d580554c98 Loren Brichter committed Feb 21, 2013
Showing with 14 additions and 15 deletions.
  1. +7 −7 OAuthCore.h
  2. +7 −8 OAuthCore.m
View
@@ -16,10 +16,10 @@ extern NSString *OAuthorizationHeader(NSURL *url,
NSString *_oAuthTokenSecret);
extern NSString *OAuthorizationHeaderWithCallback(NSURL *url,
- NSString *method,
- NSData *body,
- NSString *_oAuthConsumerKey,
- NSString *_oAuthConsumerSecret,
- NSString *_oAuthToken,
- NSString *_oAuthTokenSecret,
- NSString *_oAuthCallback);
+ NSString *method,
+ NSData *body,
+ NSString *_oAuthConsumerKey,
+ NSString *_oAuthConsumerSecret,
+ NSString *_oAuthToken,
+ NSString *_oAuthTokenSecret,
+ NSString *_oAuthCallback);
View
@@ -28,11 +28,10 @@ static NSInteger SortParameter(NSString *key1, NSString *key2, void *context) {
}
NSString *OAuthorizationHeader(NSURL *url, NSString *method, NSData *body, NSString *_oAuthConsumerKey, NSString *_oAuthConsumerSecret, NSString *_oAuthToken, NSString *_oAuthTokenSecret) {
- return OAuthorizationHeaderWithCallback(url, method, body, _oAuthConsumerKey, _oAuthConsumerSecret, _oAuthToken, _oAuthTokenSecret, nil);
+ return OAuthorizationHeaderWithCallback(url, method, body, _oAuthConsumerKey, _oAuthConsumerSecret, _oAuthToken, _oAuthTokenSecret, nil);
}
-NSString *OAuthorizationHeaderWithCallback(NSURL *url, NSString *method, NSData *body, NSString *_oAuthConsumerKey, NSString *_oAuthConsumerSecret, NSString *_oAuthToken, NSString *_oAuthTokenSecret, NSString *_oAuthCallback)
-{
+NSString *OAuthorizationHeaderWithCallback(NSURL *url, NSString *method, NSData *body, NSString *_oAuthConsumerKey, NSString *_oAuthConsumerSecret, NSString *_oAuthToken, NSString *_oAuthTokenSecret, NSString *_oAuthCallback) {
NSString *_oAuthNonce = [NSString ab_GUID];
NSString *_oAuthTimestamp = [NSString stringWithFormat:@"%d", (int)[[NSDate date] timeIntervalSince1970]];
NSString *_oAuthSignatureMethod = @"HMAC-SHA1";
@@ -80,11 +79,11 @@ static NSInteger SortParameter(NSString *key1, NSString *key2, void *context) {
NSString *normalizedParameterString = [parameterArray componentsJoinedByString:@"&"];
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]];
- }
+ 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 e40e2d0

Please sign in to comment.