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

Footer: remove jsonp call #7756

Merged
merged 3 commits into from
Dec 15, 2020
Merged

Footer: remove jsonp call #7756

merged 3 commits into from
Dec 15, 2020

Conversation

stsewd
Copy link
Member

@stsewd stsewd commented Dec 15, 2020

Use normal json instead,
we don't have problems with CORS anymore and this allow us to cache the
footer.

Use normal json instead,
we don't have problems with CORS anymore and this allow us to cache the
footer.
@stsewd stsewd requested a review from a team December 15, 2020 18:07
Copy link
Member

@ericholscher ericholscher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me 👍

Copy link
Contributor

@davidfischer davidfischer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will work as long as the proxied_api_host is the same as the host. Otherwise it won't work. Also, you can remove crossDomain: true, I believe.

@ericholscher
Copy link
Member

We should probably just change the function name on the jsonp call to be consistent tho, and that will solve this issue with fewer changes. 👍

Copy link
Member

@ericholscher ericholscher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a better approach, and protects use cases that aren't doing proxied API. I wonder if the analytics endpoint should use jsonp for consistency?

@stsewd stsewd merged commit cc6cda4 into master Dec 15, 2020
@stsewd stsewd deleted the remove-jsonp-footer branch December 15, 2020 21:10
@stsewd
Copy link
Member Author

stsewd commented Dec 15, 2020

I wonder if the analytics endpoint should use jsonp for consistency?

The way I see it, jsonp is just a hack around CORS, I think new endpoints should use CORS rules to fix that.
We already do something like that here https://github.com/readthedocs/readthedocs.org/blob/master/readthedocs/core/signals.py#L36-L36

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

Successfully merging this pull request may close these issues.

3 participants