Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support text/javascript as valid content-type for JSON responses #34

Open
GoogleCodeExporter opened this issue May 29, 2015 · 1 comment

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?

Do OAuth2 with Dropbox Core API using gtm-oauth2

What is the expected output? What do you see instead?

Expect: get access token back
Actual: get nil for the access token

What version of the product are you using? On what operating system?

latest

Please provide any additional information below.

GTMOAuth2Authentication.m in 

- (void)tokenFetcher:(GTMOAuth2Fetcher *)fetcher
    finishedWithData:(NSData *)data
               error:(NSError *)error {

determines if the response is JSON when a response's Content-Type is 
"application/json"

some services, like dropbox, are returning JSON and setting Content-Type to 
"text/javascript".  When that happens gtm-oauth doesn't parse the response 
properly, succeeding but not passing the access token along.

The dart team ran into the same snag and fixed their stuff: 
https://code.google.com/p/dart/issues/detail?id=17067

Original issue reported on code.google.com by s...@stridelabs.com on 21 Feb 2015 at 7:48

@GoogleCodeExporter
Copy link
Author

https://github.com/Everalbum/gtm-oauth2/commit/ac1f680ffddb90586071f78e655fe1e2c
6162a4a

Original comment by s...@stridelabs.com on 21 Feb 2015 at 8:13

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant