From 49f21894d3f643e8417ff717613f15461aa73491 Mon Sep 17 00:00:00 2001 From: Mario Finelli Date: Tue, 18 Feb 2020 17:19:52 -0500 Subject: [PATCH] Use `tr` instead of `gsub` --- rack-protection/lib/rack/protection/content_security_policy.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rack-protection/lib/rack/protection/content_security_policy.rb b/rack-protection/lib/rack/protection/content_security_policy.rb index 400288e79d..19f64315b4 100644 --- a/rack-protection/lib/rack/protection/content_security_policy.rb +++ b/rack-protection/lib/rack/protection/content_security_policy.rb @@ -62,7 +62,7 @@ def csp_policy # Set these key values to boolean 'true' to include in policy NO_ARG_DIRECTIVES.each do |d| if options.key?(d) && options[d].is_a?(TrueClass) - directives << d.to_s.gsub(/_/, '-') + directives << d.to_s.tr('_', '-') end end