Permalink
Browse files

Fix for trailing slash in redirect_uri for Flattr.

  • Loading branch information...
neonichu committed May 26, 2012
1 parent 482e9c4 commit 706cec13672742398a70fb3c7a4bbc800402ab05
Showing with 17 additions and 4 deletions.
  1. +5 −3 OAuth2Client.xcodeproj/project.pbxproj
  2. +5 −1 Sources/NSURL+NXOAuth2.m
  3. +7 −0 Sources/OAuth2Client/NXOAuth2Connection.m
@@ -362,7 +362,7 @@
0867D690FE84028FC02AAC07 /* Project object */ = {
isa = PBXProject;
attributes = {
- LastUpgradeCheck = 0420;
+ LastUpgradeCheck = 0430;
ORGANIZATIONNAME = nxtbgthng;
};
buildConfigurationList = 1DEB922208733DC00010E9CD /* Build configuration list for PBXProject "OAuth2Client" */;
@@ -456,7 +456,8 @@
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = Sources/OAuth2Client_Prefix.pch;
- GCC_VERSION = com.apple.compilers.llvmgcc42;
+ GCC_THUMB_SUPPORT = NO;
+ GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
INSTALL_PATH = /usr/local/lib;
PRODUCT_NAME = OAuth2Client;
SDKROOT = iphoneos;
@@ -477,7 +478,8 @@
GCC_MODEL_TUNING = G5;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = Sources/OAuth2Client_Prefix.pch;
- GCC_VERSION = com.apple.compilers.llvmgcc42;
+ GCC_THUMB_SUPPORT = NO;
+ GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
INSTALL_PATH = /usr/local/lib;
PRODUCT_NAME = OAuth2Client;
SDKROOT = iphoneos;
View
@@ -50,7 +50,11 @@ - (NSURL *)nxoauth2_URLWithoutQueryString;
- (NSString *)nxoauth2_URLStringWithoutQueryString;
{
NSArray *parts = [[self absoluteString] componentsSeparatedByString:@"?"];
- return [parts objectAtIndex:0];
+ NSString* result = [parts objectAtIndex:0];
+ if ([result hasSuffix:@"/"]) {
+ result = [result substringToIndex:result.length - 1];
+ }
+ return result;
}
@end
@@ -467,6 +467,13 @@ - (void)connectionDidFinishLoading:(NSURLConnection *)connection;
client.accessToken = nil;
}
}
+
+#if (NXOAuth2ConnectionDebug)
+ NSString* responseData = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
+ NSLog(@"Authorization failed with URL: %@, headers: %@, response: %@", self.response.URL,
+ [(NSHTTPURLResponse*)response allHeaderFields], responseData);
+ [responseData release];
+#endif
NSString *localizedError = [NSString stringWithFormat:NSLocalizedString(@"HTTP Error: %d", @"NXOAuth2HTTPErrorDomain description"), self.statusCode];
NSDictionary *errorUserInfo = [NSDictionary dictionaryWithObject:localizedError forKey:NSLocalizedDescriptionKey];

0 comments on commit 706cec1

Please sign in to comment.