Skip to content

Commit 709438a

Browse files
Securityheaders cf (#556)
* security headers * cp * cp * test * fix * credentialless
1 parent dba6b37 commit 709438a

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

website/_headers

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Please note that the docs is hosted under the homepage's domain, so security headers should be copied here from the homepage repository to here so CloudFlare Pages have the same security headers as it would be from an nginx hosted version.
2+
3+
/*
4+
Strict-Transport-Security: max-age=31536000; includeSubDomains
5+
X-Content-Type-Options: nosniff
6+
X-Frame-Options: SAMEORIGIN
7+
Referrer-Policy: strict-origin
8+
Permissions-Policy: accelerometer=(),autoplay=(),camera=(),display-capture=(),document-domain=(),encrypted-media=(),fullscreen=(self),geolocation=(),gyroscope=(),magnetometer=(),microphone=(),midi=(),payment=(),picture-in-picture=(),publickey-credentials-get=(),screen-wake-lock=(),sync-xhr=(self),usb=(),web-share=(),xr-spatial-tracking=()
9+
Cross-Origin-Opener-Policy: same-origin
10+
Cross-Origin-Resource-Policy: same-origin
11+
Cross-Origin-Embedder-Policy: credentialless
12+
Content-Security-Policy: default-src 'none'; frame-src 'self' https://*.configcat.com https://www.google.com https://challenges.cloudflare.com https://www.youtube.com https://*.googletagmanager.com https://td.doubleclick.net; script-src 'self' 'unsafe-inline' https://*.configcat.com https://*.googletagmanager.com https://googletagmanager.com https://tagmanager.google.com https://*.google-analytics.com https://www.google.com https://www.gstatic.com https://challenges.cloudflare.com https://*.cloudflareinsights.com https://*.cello.so https://*.smartlook.com; style-src 'self' 'unsafe-inline' *.bootstrapcdn.com https://fonts.googleapis.com https://googletagmanager.com https://tagmanager.google.com https://use.typekit.net https://p.typekit.net; font-src 'self' data: https://fonts.gstatic.com https://fonts.googleapis.com https://use.typekit.net; img-src 'self' data: https://*.configcat.com https://*.google-analytics.com https://*.google.com https://*.googletagmanager.com https://codecov.io https://img.shields.io https://github.com https://snyk.io https://sonarcloud.io https://data.jsdelivr.com https://maven-badges.herokuapp.com https://javadoc.io https://ci.appveyor.com https://buildstats.info https://goreportcard.com https://godoc.org https://poser.pugx.org https://badge.fury.io https://coveralls.io https://pkg.go.dev https://s3.amazonaws.com https://*.cloudfront.net https://img.youtube.com https://thepracticaldev.s3.amazonaws.com https://raw.githubusercontent.com https://blog.ladeak.net; media-src 'self'; connect-src 'self' https://*.configcat.com https://*.googletagmanager.com https://*.google-analytics.com https://*.analytics.google.com https://*.g.doubleclick.net https://*.google.com https://*.amplitude.com https://*.cloudflareinsights.com https://*.algolia.net https://*.cello.so https://*.smartlook.com https://*.smartlook.cloud; object-src 'self'; child-src 'self' blob:; frame-ancestors 'self'; upgrade-insecure-requests; block-all-mixed-content; base-uri 'self'; manifest-src 'self';

website/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"serve": "docusaurus serve",
1212
"gen-api-docs": "docusaurus gen-api-docs all && node ./api/cleanup-api-docs.js",
1313
"typecheck": "tsc",
14-
"cf": "npm run gen-api-docs && docusaurus build --out-dir build/docs && echo / /docs > build/_redirects && node testrobots.js"
14+
"cf": "npm run gen-api-docs && docusaurus build --out-dir build/docs && echo / /docs > build/_redirects && node testrobots.js && cp _headers build/_headers"
1515
},
1616
"dependencies": {
1717
"@docusaurus/core": "^3.5.2",

0 commit comments

Comments
 (0)