guides icon indicating copy to clipboard operation
guides copied to clipboard

A section to integrate Custom Headers in hugo using Netlify

Open Nirzak opened this issue 3 years ago • 0 comments

Describe the solution you'd like

Code

Currently, one can integrate custom HTTP headers to Hugo site by adding the below code portion to netlify.toml file [[headers]] for = "/*" [headers.values] X-Frame-Options = "DENY" X-XSS-Protection = "1; mode=block" X-Content-Type-Options = "nosniff" Content-Security-Policy = "" Referrer-Policy = "strict-origin-when-cross-origin" Strict-Transport-Security = "max-age=2592000" Permissions-Policy = ''' 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)'''

Currently, I have kept the content-security-policy section blank because it can be different for particular sites based on their src of javascript files, image files, and style files.

Nirzak avatar Apr 05 '21 20:04 Nirzak