warehouse icon indicating copy to clipboard operation
warehouse copied to clipboard

Add CORS headers to HTTP exceptions

Open ryanking13 opened this issue 1 year ago • 0 comments

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

ryanking13 avatar Jul 25 '24 15:07 ryanking13