Skip to content

Commit 81e3a87

Browse files
authored
Apply remaining changes
1 parent f61c92d commit 81e3a87

2 files changed

Lines changed: 14 additions & 2 deletions

File tree

docs/tooling/cloudflare-pages.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,10 @@ The app uses two Cloudflare Pages configuration files in the `web/` directory:
5555

5656
**Security headers** (all environments):
5757
- `X-Content-Type-Options: nosniff`
58-
- `X-Frame-Options: SAMEORIGIN`
58+
- `X-Frame-Options: DENY`
5959
- `Referrer-Policy: strict-origin-when-cross-origin`
60-
- `Content-Security-Policy: default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; ...`
60+
- `Strict-Transport-Security: max-age=31536000; includeSubDomains`
61+
- `Content-Security-Policy` including Flutter-safe `script-src 'wasm-unsafe-eval'` and Firebase/data `connect-src` origins
6162

6263
> **Note**: Both `_headers` and `_redirects` files are automatically included in the Flutter web build output (`build/web/`) and deployed with the app. These files are processed by Cloudflare Pages during deployment to configure the platform - **they won't appear in the list of uploaded assets** in the Cloudflare dashboard, but they are applied to the deployment. Domain-specific rules for staging are placed at the end of the `_headers` file to ensure they override path-based production rules.
6364

web/_headers

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
# Cloudflare Pages Headers Configuration
22
# See: https://developers.cloudflare.com/pages/platform/headers/
33

4+
# Global security headers (all environments)
5+
/*
6+
# CSP notes:
7+
# - script-src keeps Flutter/CanvasKit working via 'wasm-unsafe-eval'
8+
# - connect-src allows app API plus Firebase Analytics/Crashlytics endpoints
9+
Content-Security-Policy: default-src 'self'; base-uri 'self'; frame-ancestors 'none'; object-src 'none'; script-src 'self' 'wasm-unsafe-eval' https://www.googletagmanager.com; style-src 'self' 'unsafe-inline'; img-src 'self' data: blob: https:; font-src 'self' data:; connect-src 'self' https://data.cambeerfestival.app https://www.google-analytics.com https://region1.google-analytics.com https://firebaseinstallations.googleapis.com https://firebaselogging-pa.googleapis.com; worker-src 'self' blob:;
10+
X-Content-Type-Options: nosniff
11+
X-Frame-Options: DENY
12+
Referrer-Policy: strict-origin-when-cross-origin
13+
Strict-Transport-Security: max-age=31536000; includeSubDomains
14+
415
# Production Environment - Explicit domain rule for clarity
516
# Custom domain: cambeerfestival.app
617
# Path-based rules below apply to this domain for performance optimization

0 commit comments

Comments
 (0)