I am deploying a Hugo site through Github pages, but I want to add custom HTTP headers like X-Frame-Options, X-XSS-protections. However, I tried to add the below code to my config.yaml file as per their site's instruction. But it isn't working. The site still has header vulnerabilities. Can someone help me in this regard.
headers:
- for: /**.html
values:
Content-Security-Policy: connect-src api.github.com; font-src cdnjs.cloudflare.com fonts.googleapis.com; img-src 'self' www.countryflags.io; script-src-elem 'unsafe-inline' cdnjs.cloudflare.com 'self'; style-src-attr 'unsafe-inline'; style-src-elem 'self' 'unsafe-inline' cdnjs.cloudflare.com fonts.googleapis.com
Referrer-Policy: strict-origin-when-cross-origin
X-Content-Type-Options: nosniff
X-Frame-Options: DENY
Strict-Transport-Security = max-age=2592000
X-XSS-Protection: 1; mode=block