diff --git a/Source/GTMOAuth2Authentication.m b/Source/GTMOAuth2Authentication.m index ac1e081..04ec229 100644 --- a/Source/GTMOAuth2Authentication.m +++ b/Source/GTMOAuth2Authentication.m @@ -741,7 +741,7 @@ - (GTMOAuth2Fetcher *)beginTokenFetchWithDelegate:(id)delegate NSString *code = self.code; NSString *assertion = self.assertion; NSString *grantType = nil; - + if (refreshToken) { // We have a refresh token grantType = @"refresh_token"; @@ -869,6 +869,7 @@ - (void)tokenFetcher:(GTMOAuth2Fetcher *)fetcher NSDictionary *responseHeaders = [fetcher responseHeaders]; NSString *responseType = [responseHeaders valueForKey:@"Content-Type"]; + // "text/javascript" supports Dropbox's out-of-spec OAuth 2. BOOL isResponseJSON = ([responseType hasPrefix:@"application/json"] || [responseType hasPrefix:@"text/javascript"]); BOOL hasData = ([data length] > 0);