Skip to content

Instantly share code, notes, and snippets.

@noxasch
Created May 16, 2021 22:30
Show Gist options
  • Save noxasch/7f3c2ba0a4ca85d67b52a05a0473e82c to your computer and use it in GitHub Desktop.
Save noxasch/7f3c2ba0a4ca85d67b52a05a0473e82c to your computer and use it in GitHub Desktop.
netlify.toml for header which CSP from various CDN
[[headers]]
for = "/*"
[headers.values]
X-Frame-Options = "DENY"
X-XSS-Protection = "1; mode=block"
X-Content-Type-Options = "nosniff"
Referrer-Policy = "no-referrer"
Content-Security-Policy = '''
default-src 'self';
font-src fonts.gstatic.com; style-src 'self' fonts.googleapis.com;
script-src 'self' cdnjs.cloudflare.com code.jquery.com;
script-src-elem www.google-analytics.com www.googletagmanager.com 'unsafe-inline' cdnjs.cloudflare.com code.jquery.com;
'''
Permissions-Policy = '''
interest-cohort=()
accelerometer=(none),
ambient-light-sensor=(none),
autoplay=(none),
camera=(none),
encrypted-media=(none),
fullscreen=(none),
geolocation=(none),
gyroscope=(none),
magnetometer=(none),
microphone=(none),
midi=(none),
payment=(none),
picture-in-picture=(none),
speaker=(none),
usb=(none),
vibrate=(none),
vr=(none)
'''
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment