Skip to content

Commit

Permalink
Format.
Browse files Browse the repository at this point in the history
  • Loading branch information
lgarron committed Aug 17, 2022
1 parent 801a002 commit 60dd23f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/secure_headers/headers/content_security_policy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def build_source_list_directive(directive)
[symbol_to_hyphen_case(directive), minified_source_list].join(" ").strip
end
end

# Private: Calculates a modified version version of source_list:
# - where any expression containing a deprecated character (semicolon or newline) has been split by that
# character, and
Expand All @@ -134,7 +134,7 @@ def clean_malformatted_sources(directive, source_list)
cleaned_source_list.append(expression)
end
end
cleaned_source_list.select{ | value | value != "" }
cleaned_source_list.select { |value| value != "" }
end

# If a directive contains *, all other values are omitted.
Expand Down Expand Up @@ -177,7 +177,7 @@ def dedup_source_list(sources)
host_source_expressions = sources.map { |source| parse_source_expression(source) }
# TODO: Split by source expression type.
wildcard_host_source_expressions = host_source_expressions.select { |source| source.has_wildcard? }

filtered = host_source_expressions.select do |source|
wildcard_host_source_expressions.none? { |wildcard_source| wildcard_source != source && wildcard_source.matches_same_or_superset?(source) }
end
Expand Down

0 comments on commit 60dd23f

Please sign in to comment.