Enable CORS for the public registry endpoints #117
-
Ref: npm/npm-registry-couchapp#108 (comment); Raising again since I suspect the registry should now already have solid protections against DDoS that it didn't have in 2016. The registry endpoints don't have CORS headers, requiring to go through a proxy to fetch packages (metadata + tarballs) from a browser. In particular, the two following endpoints would benefit from that:
|
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 26 replies
-
The public API endpoints which are available on As @arcanis has described, adding CORS headers to specific public registry endpoints would really open things up for the community to build awesome things on top of npm data. |
Beta Was this translation helpful? Give feedback.
-
Looks like CORS headers are missing for the registry indeed https://registry.npmjs.org/prisma One workaround would be to use npms https://api.npms.io/v2/package/prisma |
Beta Was this translation helpful? Give feedback.
-
Hey All, I've opened a ticket with our engineering team to discuss this feature request and will get back to y'all |
Beta Was this translation helpful? Give feedback.
-
This works for us for now https://npmjs.cf/ |
Beta Was this translation helpful? Give feedback.
-
CORS is launched and major issues resolved 🎉 |
Beta Was this translation helpful? Give feedback.
-
Hi, I finally made "npm" work in browser (npm-in-browser) thanks to this CORS header 🎉 However, I found that CORS is not enabled for "HTTP 404 Not Found" responses and this is causing a mismatch with real npm CLI in local machines in terms of its observable behavior. Do you think we can make sure that I filed an issue in npm-in-browser, which explains more details and reproductions: naruaway/npm-in-browser#1 |
Beta Was this translation helpful? Give feedback.
CORS is launched and major issues resolved 🎉