-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
CORS problems around API #6154
Comments
We shouldn't use jsonp for new code, we should use a CORS solution instead. And for public and read only endpoints. |
Why not?
How is that solution? |
jsonp is to get around CORS, we are opening too much with that, I linked this in other of our projects (private). You can read the warning on this project for example https://jpadilla.github.io/django-rest-framework-jsonp/. This lib is for handling CORS on django https://github.com/adamchainz/django-cors-headers and it's recommended from django rest framework https://www.django-rest-framework.org/topics/ajax-csrf-cors/#cors |
Thanks @stsewd for the data! We already have |
I'm closing this issue because it's old and it does not adds value to the current situation. We have talked about CORS recently and we are working on the changes required. |
This was closed without pointing to the current discussion. Where can I follow the progress? I am not able to access the API from |
Hi @jobisoft
The discussion wasn't public. We will update the documentation for our API to reflect these decisions soon.
What API endpoints are you using? You should probably use the Proxied API that we designed for this particular case: instead of hitting |
@humitos : Thanks for your response. The endpoint I am currently using is this: The page itself is here: But I cannot seem to get the proxy endpoint running: I also tried v3 at Could you point me to documentation regarding proxy API? It definitely would solve my issues. Thanks for your time! |
Thanks for your support, really appreciated. My use case is the popular version warning extension, which can add banners to a readthedocs page and inform users, if they are looking at an outdated version. The beauty of the API usage there: All old versions could add pointers to all other available versions without being manually updated each time a new version has been released. I solved this now by manually including a static json file in my "latest" version, which holds the information I would get back from the API. Since all old versions now fetch the file from the "latest" version, they will always be up to date again and I only have to update my static json. Maybe that helps others in the meantime. Looking forward to the upcoming changes in the footer API! |
We currently support JSONP on APIv2 in the Footer HTML endpoint only.
Supporting JSONP on APIv3 will allow to query the API from different custom domains.
Suggested at #6152
The text was updated successfully, but these errors were encountered: