warehouse
warehouse copied to clipboard
Add CORS headers to HTTP exceptions
Resolve #14229
This adds CORS headers to the response when warehouse returns404, 410, 50x responses.
I added the same CORS headers to simple APIs in https://github.com/pypi/warehouse/pull/13222, but they were not applied on an error case.
Context
In pyodide, we are implementing a fallback option for package index, so that if a package is not available in one package index, then search it in another package index. However, without the CORS headers, it is impossible to distinguish the 404 Not Found error.
cc: @Carreau