view modules/website/lib/puppet/parser/functions/hash_to_csp.rb @ 263:f99974dc0f1a

Add a way to skip setting CSP NextCloud manages CSP itself, so we don't need the header in the PIM subdomain causing confusion and incorrect results
author IBBoard <dev@ibboard.co.uk>
date Sun, 29 Dec 2019 16:43:55 +0000
parents 1e65604c182a
children
line wrap: on
line source

module Puppet::Parser::Functions
	newfunction(:hash_to_csp, :type => :rvalue) do |args|
		csp_defaults = args[0]
		csp_overrides = args[1]
		csp_combined = csp_defaults.merge(csp_overrides == "" ? {} : csp_overrides)
		csp_string = csp_combined.map { |index, value| "#{index} #{value}" }.join ("; ")
	end
end