Skip to content

Commit 1f4b9dd

Browse files
KyFaStlgarron
andauthored
Apply suggestions from code review
Co-authored-by: Lucas Garron <[email protected]>
1 parent ec6852b commit 1f4b9dd

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

lib/secure_headers/headers/content_security_policy.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@ def value
5151
def build_value
5252
directives.map do |directive_name|
5353
case DIRECTIVE_VALUE_TYPES[directive_name]
54-
when :source_list, :require_sri_for_list, :require_trusted_types_for_list # require_sri is a simple set of strings that don't need to deal with symbol casing
54+
when :source_list,
55+
:require_sri_for_list, # require_sri is a simple set of strings that don't need to deal with symbol casing
56+
:require_trusted_types_for_list
5557
build_source_list_directive(directive_name)
5658
when :boolean
5759
symbol_to_hyphen_case(directive_name) if @config.directive_value(directive_name)

spec/lib/secure_headers/headers/content_security_policy_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ module SecureHeaders
141141
expect(csp.value).to eq("default-src 'self'; require-sri-for script style")
142142
end
143143

144-
it "allows style as a require-trusted-types-src" do
144+
it "allows style as a require-trusted-types-for source" do
145145
csp = ContentSecurityPolicy.new(default_src: %w('self'), require_trusted_types_for: %w(script))
146146
expect(csp.value).to eq("default-src 'self'; require-trusted-types-for script")
147147
end

0 commit comments

Comments
 (0)