From 48f2ceefe1685493480af006e2d8afed38c23957 Mon Sep 17 00:00:00 2001 From: George Cushen Date: Sat, 26 Feb 2022 14:06:07 +0000 Subject: [PATCH] feat: add security option to allow frames site.Params.security.allow_frame --- wowchemy/layouts/index.headers | 5 +++-- wowchemy/layouts/index.redirects | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/wowchemy/layouts/index.headers b/wowchemy/layouts/index.headers index 1721765a..a594b05b 100644 --- a/wowchemy/layouts/index.headers +++ b/wowchemy/layouts/index.headers @@ -1,12 +1,13 @@ {{- $csp_policy := site.Params.security.csp.policy | default "" -}} {{- $csp_report_only := site.Params.security.csp.report_only | default false -}} +{{- $allow_frame := site.Params.security.allow_frame | default false -}} {{- $default_perms := "accelerometer=(), camera=(), geolocation=(), gyroscope=(), magnetometer=(), microphone=(), payment=(), usb=()" -}} {{- $permissions_policy := site.Params.security.permissions.policy | default $default_perms -}} # Netlify headers # Automatically generated -# Documentation: http://bit.ly/netlify-deployment +# Documentation: https://wowchemy.com/docs/hugo-tutorials/security/ /* - X-Frame-Options: DENY + {{if not $allow_frame}}X-Frame-Options: DENY{{end}} X-XSS-Protection: 1; mode=block X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains diff --git a/wowchemy/layouts/index.redirects b/wowchemy/layouts/index.redirects index 64601bfa..2bfec12f 100644 --- a/wowchemy/layouts/index.redirects +++ b/wowchemy/layouts/index.redirects @@ -1,6 +1,6 @@ # Netlify redirects # Automatically generated -# Documentation: http://bit.ly/netlify-deployment +# Documentation: https://docs.netlify.com/routing/redirects/ {{- /* Note: code purposely un-indented to preserve required spacing in output. */ -}} {{- range $page := where site.AllPages ".Aliases" "!=" nil -}} {{- range $page.Aliases }}