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

Use JSONP by default #8

Closed
captn3m0 opened this issue Jul 13, 2012 · 1 comment
Closed

Use JSONP by default #8

captn3m0 opened this issue Jul 13, 2012 · 1 comment

Comments

@captn3m0
Copy link
Contributor

This might sound weird, but it helps in two ways :

  • [Github API only accepts CORS requests from oauth registered domains](http://developer.github.com/v3/#cross-origin-resource-sharing]. This means to setup a working app that uses basic authentication, you will still have to setup an oauth application just to whitelist your domain. I found this out when I tested my app on something other than localhost.
  • Since the current github.js API does not pass the headers via callbacks, the response headers are neglected. This includes things like rate limits and pagination urls, which might be useful to developers, but are not passed. Using Jsonp would make sure that this is passed along as well.

As such, this would lead to losing nothing and making things a lot easier for the end users. For instance, anyone could just fork my repository, and it would automatically work for them at username.github.com/repo/ if I shift to gh-pages without them having to create an oauth application.

@captn3m0
Copy link
Contributor Author

Just realized that using JSONP would negate Basic Auth support (you can't send headers on script tags). I've contacted github support for enabling CORS on all domains, since it is a meaningless filter (it does not offer any benefits that I can think of).

Closing this as switching to JSONP would cause loss of functionality.

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

No branches or pull requests

1 participant