From c4f56a567b3f8a0f8b4cab4c3e8dcdaaf035545a Mon Sep 17 00:00:00 2001 From: Serghei Iakovlev Date: Sun, 24 Jul 2022 18:34:13 +0200 Subject: Add script to path netlify.toml file to allow some violation for CSP header --- netlify-update-csp-headers.rb | 42 ------------------------------------------ 1 file changed, 42 deletions(-) delete mode 100755 netlify-update-csp-headers.rb (limited to 'netlify-update-csp-headers.rb') diff --git a/netlify-update-csp-headers.rb b/netlify-update-csp-headers.rb deleted file mode 100755 index 5f89c46..0000000 --- a/netlify-update-csp-headers.rb +++ /dev/null @@ -1,42 +0,0 @@ -#!/usr/bin/env ruby - -NETLIFY_CONFIG = 'netlify.toml' - -text = File.read(NETLIFY_CONFIG) - -# => default-src 'self'; -# <= default-src 'self' blob:; -text = text.gsub( - /(default-src) ('self')(;)/, - "\\1 \\2 blob:\\3" -) - -# => style-src 'self'; -# <= style-src 'self' 'unsafe-inline'; -text = text.gsub( - /(style-src) ('self')(;)/, - "\\1 \\2 'unsafe-inline'\\3" -) - -# => media-src 'self'; -# <= media-src 'self' blob: https://app.netlify.com; -text = text.gsub( - /(media-src) ('self')(;)/, - "\\1 'self' blob: https://app.netlify.com\\3" -) - -# => frame-src 'none'; -# <= frame-src app.netlify.com; -text = text.gsub( - /(frame-src) ('none')(;)/, - "\\1 app.netlify.com\\3" -) - -# => script-src 'self' *.googletagmanager.com; -# <= script-src 'self' *.googletagmanager.com netlify-cdp-loader.netlify.app; -text = text.gsub( - /(script-src) ('self' \*.googletagmanager.com)(;)/, - "\\1 \\2 netlify-cdp-loader.netlify.app\\3" -) - -File.open(NETLIFY_CONFIG, "w") { |file| file << text } -- cgit v1.2.3