Skip to content

Commit 9867453

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

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
@@ -53,7 +53,9 @@ def value
5353
def build_value
5454
directives.map do |directive_name|
5555
case DIRECTIVE_VALUE_TYPES[directive_name]
56-
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
56+
when :source_list,
57+
:require_sri_for_list, # require_sri is a simple set of strings that don't need to deal with symbol casing
58+
:require_trusted_types_for_list
5759
build_source_list_directive(directive_name)
5860
when :boolean
5961
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
@@ -146,7 +146,7 @@ module SecureHeaders
146146
expect(csp.value).to eq("default-src 'self'; require-sri-for script style")
147147
end
148148

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

0 commit comments

Comments
 (0)