lib/roda/plugins/content_security_policy.rb in roda-3.35.0 vs lib/roda/plugins/content_security_policy.rb in roda-3.36.0

- old
+ new

@@ -54,10 +54,11 @@ # * img_src # * manifest_src # * media_src # * object_src # * plugin_types + # * report_to # * report_uri # * require_sri_for # * sandbox # * script_src # * style_src @@ -121,10 +122,11 @@ img-src manifest-src media-src object-src plugin-types + report-to report-uri require-sri-for sandbox script-src style-src @@ -143,12 +145,10 @@ end # add_* method name adds to the setting value, or clears setting if no values # are given. define_method("add_#{meth}") do |*args| - if args.empty? - @opts[setting] - else + unless args.empty? @opts[setting] ||= EMPTY_ARRAY @opts[setting] += args @opts[setting].freeze end nil