Skip to content

Commit

Permalink
try different headers method
Browse files Browse the repository at this point in the history
  • Loading branch information
goodroot committed Dec 12, 2024
1 parent 54f5261 commit 3ba601d
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 62 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,7 @@ jobs:
CONTEXT: deploy-preview
NETLIFY: true
run: |
mkdir -p ./static
cp ./custom-headers/_previewHeaders ./static/_headers
yarn build
ls -la ./build/_headers || echo "Headers file not found in build"
cat ./build/_headers || echo "Cannot read headers file"
- name: Deploy to Netlify
uses: jsmrcaga/[email protected]
Expand Down
14 changes: 14 additions & 0 deletions custom-headers/_productionHeaders
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 0
X-Content-Type-Options: nosniff
Content-Security-Policy: frame-src 'self' app.netlify.com *.demo.questdb.io *.questdb.io www.youtube.com www.slideshare.net forms.hsforms.com;

/static/*
Cache-Control: public, max-age=31536000, immutable

*.js
Cache-Control: public, max-age=31536000, immutable

*.css
Cache-Control: public, max-age=31536000, immutable
33 changes: 4 additions & 29 deletions netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -635,33 +635,8 @@ to = "/enterprise/"
status = 301
force = true

[context.production]
command = "npm run build && cp ./custom-headers/_productionHeaders ./build/_headers"

[[headers]]
for = "/*"
[headers.values]
X-Frame-Options = "SAMEORIGIN"
X-XSS-Protection = "0"
X-Content-Type-Options = "nosniff"
Content-Security-Policy = "frame-src 'self' app.netlify.com *.demo.questdb.io *.questdb.io www.youtube.com www.slideshare.net forms.hsforms.com;"

[[headers]]
for = "/static/*"
[headers.values]
Cache-Control = "public, max-age=31536000, immutable"

[[headers]]
for = "*.js"
[headers.values]
Cache-Control = "public, max-age=31536000, immutable"

[[headers]]
for = "*.css"
[headers.values]
Cache-Control = "public, max-age=31536000, immutable"

[[redirects]]
from = "/docs/*"
to = "/:splat"
status = 200
force = true
conditions = {Context = "deploy-preview"}
[context.deploy-preview]
command = "yarn build && cp ./custom-headers/_previewHeaders ./build/_headers"
29 changes: 0 additions & 29 deletions static/_headers

This file was deleted.

0 comments on commit 3ba601d

Please sign in to comment.