Hacker News new | ask | show | jobs
by ourcat 1708 days ago
ServiceWorkers also don't play nice with CORS in my experience. We often need to bypass them in Angular when making certain requests.
1 comments

Author here! I'm also an editor on the service worker spec, so I'm interested to know where the pain points are.
Hi Jake! (I watch your videos ;)) Many times, the (Angular) ServiceWorker has given us CORS headaches on various requests to our APIs and AWS storage files. The only method we've found, after various AWS configs and ngsw-config.json attempts, was to add `ngsw-bypass=true` to all requests. I'll see if I can find the Github issue, where this has come up before.

Incidentally, while you're here, I'm planning on building something which will require use of SharedArrayBuffer. Will adding the (now) required Cross-Origin isolation COOP/COEP headers cause any issues to existing CORS setups?

:)

COOP+COEP won't change how CORS works, but it means you can't have no-cors resources on your page unless they have CORP headers
Very useful info. Thanks!