[Cloudflare Pages] Add CORS header

GitHub Pages has Access-Control-Allow-Origin:* header by default.
I want to use this feature in Cloudflare Pages too, or whether it can be adjusted.

Right now you can’t alter that directly with Pages, however as of last night you can now situate Cloudflare Workers in front of your Pages site, meaning that you can alter the headers that are returned.

Have a look at this guide, you can probably build around this.

1 Like

It’s a way…but, simple is better than complicated.

Agreed, it would be a nice feature to natively have, but it’s a fairly alright workaround for now the worker code will end up fairly small.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.