Conversation
di
reviewed
Mar 17, 2023
di
reviewed
Mar 23, 2023
di
approved these changes
Mar 23, 2023
Member
|
Thanks! Good luck with Pyodide, definitely let us know if you need anything else! |
5 tasks
Contributor
Author
|
@di Hi, it seems that packages that have been cached before this PR don't have this header yet. Is there a regular period when PyPI flushes the cache? For example, pyperformance (https://pypi.org/simple/pyperformance) has CORS headers: $ curl -v https://pypi.org/simple/pyperformance/ 2>&1 | grep access-control
< access-control-allow-headers: Content-Type, If-Match, If-Modified-Since, If-None-Match, If-Unmodified-Since
< access-control-allow-methods: GET
< access-control-allow-origin: *
< access-control-expose-headers: X-PyPI-Last-Serial
< access-control-max-age: 86400while, snowballstemmer (https://pypi.org/simple/snowballstemmer/) doesn't: $ curl -v https://pypi.org/simple/snowballstemmer/ 2>&1 | grep access-control
[no headers] |
Member
|
I manually purged the cache for this one and the headers are now present: I'm not sure why our CDN was serving a stale page here, but this is likely related to #12214. If you have other examples, I can purge them as well. |
Contributor
Author
|
Thanks! I didn't realize that there was an existing issue about this. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hello from Pyodide!
This adds CORS headers to simple API to allow fetching responses from client-side JavaScript.
Additional context
Pyodide has a runtime in-browser package manager called micropip, which downloads packages from PyPI. So far, Pyodide was using the legacy
pypi.org/pypi/<name>/jsonendpoint to fetch package metadata, but we are considering migrating topypi.org/simple/. The legacy API sets CORS headers (#578), while simple API doesn't.Related:
files.pythonhosted.org#4687