Add Cloudflare Pages _headers #2

Merged
pawel merged 1 commit from pawel/cloudflare-headers into main 2026-11-12 10:37:26 +00:00
Owner

Why

The site is served with only Cloudflare's default headers: no security headers, previews can end up in search results, and gpg.asc downloads instead of opening as text.

What

  • Security headers on every path: CSP, HSTS (1 year, no subdomains), nosniff, frame denial, referrer and permissions policy, COOP.
  • CSP allows data: images because favicon.svg embeds its picture as one.
  • X-Clacks-Overhead: GNU Terry Pratchett.
  • X-Robots-Tag: noindex on *.pages.dev hostnames only.
  • text/plain for /gpg.asc, application/rss+xml for /feed.xml.

Risk

  • Checked only against local wrangler pages dev. On the preview, confirm the favicon renders in Firefox/Chrome/Safari, Content-Type isn't doubled on gpg.asc/feed.xml, and the preview host gets noindex.
  • Any future script, external image or embed needs a CSP update.
## Why The site is served with only Cloudflare's default headers: no security headers, previews can end up in search results, and `gpg.asc` downloads instead of opening as text. ## What - Security headers on every path: CSP, HSTS (1 year, no subdomains), nosniff, frame denial, referrer and permissions policy, COOP. - CSP allows `data:` images because `favicon.svg` embeds its picture as one. - `X-Clacks-Overhead: GNU Terry Pratchett`. - `X-Robots-Tag: noindex` on `*.pages.dev` hostnames only. - `text/plain` for `/gpg.asc`, `application/rss+xml` for `/feed.xml`. ## Risk - Checked only against local `wrangler pages dev`. On the preview, confirm the favicon renders in Firefox/Chrome/Safari, Content-Type isn't doubled on `gpg.asc`/`feed.xml`, and the preview host gets `noindex`. - Any future script, external image or embed needs a CSP update.
feat: add Cloudflare Pages _headers
All checks were successful
preview / preview (push) Successful in 46s
deploy / deploy (push) Successful in 40s
c5443e5716

Preview: https://pawel-cloudflare-headers.light-no-fire.pages.dev
Alias: https://9b0e0043.light-no-fire.pages.dev

Commit: c5443e571699afb22e7d8c91f609c9ea2d0d4f14

<!-- preview-bot:light-no-fire --> **Preview:** https://pawel-cloudflare-headers.light-no-fire.pages.dev **Alias:** https://9b0e0043.light-no-fire.pages.dev Commit: `c5443e571699afb22e7d8c91f609c9ea2d0d4f14`
pawel merged commit c5443e5716 into main 2026-11-12 10:37:26 +00:00
pawel deleted branch pawel/cloudflare-headers 2026-11-12 10:37:27 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
pawel/pjw.lol!2
No description provided.