Skip to content

Send security headers from Cloudflare Pages - #19

Merged
antigenius0910 merged 1 commit into
mainfrom
feature/security-headers
Oct 29, 2026
Merged

antigenius0910 merged 1 commit into
mainfrom
feature/security-headers

Conversation

@antigenius0910

Copy link
Copy Markdown
Contributor

Prepares production for removing the Cloudflare Access gate.

public/_headers (copied to dist/ by Vite, applied by Pages to every path):

  • CSP default-src 'self': the build has no inline scripts/styles and no third-party requests; plus object-src 'none', base-uri 'none', form-action 'none', frame-ancestors 'none', upgrade-insecure-requests
  • X-Frame-Options: DENY: stops other sites embedding the game (legacy fallback for frame-ancestors)
  • X-Content-Type-Options: nosniff, Referrer-Policy: no-referrer, Cross-Origin-Opener-Policy: same-origin
  • Permissions-Policy: only accelerometer/gyroscope/magnetometer (tilt input), camera/mic/geolocation/payment/usb off
  • HSTS one year, without includeSubDomains so other chuangwangfu.com hosts are untouched

Also updates the index.html manifest comment: after the gate comes off, only preview deployments stay behind Access.

The Vite dev server ignores _headers, so the playtest needs to be on this PR's Pages preview, not dev.chuangwangfu.com.

🤖 Generated with Claude Code

Prepares production for dropping the Access gate: a same-origin CSP,
no framing, nosniff, no referrer, motion sensors only, and HSTS.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying driftline with  Cloudflare Pages  Cloudflare Pages

Latest commit: 6d38804
Status: ✅  Deploy successful!
Preview URL: https://91187833.driftline-9vj.pages.dev
Branch Preview URL: https://feature-security-headers.driftline-9vj.pages.dev

View logs

@antigenius0910
antigenius0910 merged commit 14016ee into main Oct 29, 2026
2 checks passed
@antigenius0910
antigenius0910 deleted the feature/security-headers branch October 29, 2026 07:42
antigenius0910 added a commit that referenced this pull request Oct 29, 2026
The chuangwangfu.com zone auto-injects the RUM beacon into every
subdomain; the CSP from #19 blocked it on Driftline. Allow its script
host; it reports to same-origin /cdn-cgi/rum, already covered.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant