index.headers 1.1 KB

1234567891011121314151617181920
  1. {{- $csp_policy := site.Params.security.csp.policy | default "" -}}
  2. {{- $csp_report_only := site.Params.security.csp.report_only | default false -}}
  3. {{- $allow_frame := site.Params.security.allow_frame | default false -}}
  4. {{- $default_perms := "accelerometer=(), camera=(), geolocation=(), gyroscope=(), magnetometer=(), microphone=(), payment=(), usb=()" -}}
  5. {{- $permissions_policy := site.Params.security.permissions.policy | default $default_perms -}}
  6. # Netlify headers
  7. # Automatically generated
  8. # Documentation: https://wowchemy.com/docs/hugo-tutorials/security/
  9. /*
  10. {{if not $allow_frame}}X-Frame-Options: DENY{{end}}
  11. X-XSS-Protection: 1; mode=block
  12. X-Content-Type-Options: nosniff
  13. Strict-Transport-Security: max-age=31536000; includeSubDomains
  14. Referrer-Policy: strict-origin-when-cross-origin
  15. {{with $csp_policy}}Content-Security-Policy{{if $csp_report_only}}-Report-Only{{end}}: {{replaceRE "(\\s\\s+)" " " (trim . " ")}}{{end}}
  16. {{with $permissions_policy}}Permissions-Policy: {{replaceRE "(\\s\\s+)" " " (trim . " ")}}{{end}}
  17. /index.webmanifest
  18. Content-Type: application/manifest+json
  19. /index.xml
  20. Content-Type: application/rss+xml