CloudflarePages abridge.pages.dev how do I set headers like content-security-policy

CloudflarePages abridge.pages.dev how do I set headers like content-security-policy

I created a theme for the Zola static generator called abridge. The theme demo has for a long time been hosted on netlify, and setting headers is as simple as supplying a toml file:

I have generated a demo site on cloudflare pages by linking cloudflare to my github account:

The problem is that I do not know how to set headers. I tried using a worker: GitHub - securityheaders/security-headers-cloudflare-worker: A Cloudflare Worker to enable Security Headers on your site.

the worker did not seem to work, but it also seems using a rule might be simpler: HTTP response header modification rules · Cloudflare Rules docs

The problem is I only see rules for domains that I have added to cloudflare, I do not see a rules section for sites hosted on cloudflare pages.

I may have just found the answer:

2 Likes

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