mjackson / unpkg

The CDN for everything on npm
https://unpkg.com
Other
2.99k stars 302 forks source link

"Cross-Origin-Resource-Policy: cross-origin" header? #290

Open hoodmane opened 3 years ago

hoodmane commented 3 years ago

Since August 5th jsdelivr has been serving files with a Cross-Origin-Resource-Policy : cross-origin header so that JsDelivr can be used in websites that use SharedArrayBuffer and other newfangled APIs that require cross origin isolation. It would be convenient if unpkg could do the same.

See the corresponding jsdelivr issue: https://github.com/jsdelivr/jsdelivr/issues/18201

underrobyn commented 3 years ago

+1 this issue

unpkg needs to send this header, other CDNs such as CDNJS and Googleapis.com send this header

rustonaut commented 3 years ago

This for example leads to problems when trying to use flutter web (dev builds) with WASM using SharedArrayBuffer buffers to have something "like" threading. (As by default for dev builds https://unpkg.com/canvaskit-wasm@0.28.1/bin/canvaskit.js is used.)