lib/hanami/config/actions.rb in hanami-2.1.0.beta1 vs lib/hanami/config/actions.rb in hanami-2.1.0.beta2

- old
+ new

@@ -97,16 +97,11 @@ # @api private def initialize(*, **options) super() @base_config = Hanami::Action.config.dup - @content_security_policy = ContentSecurityPolicy.new do |csp| - if assets_server_url = options[:assets_server_url] - csp[:script_src] += " #{assets_server_url}" - csp[:style_src] += " #{assets_server_url}" - end - end + @content_security_policy = ContentSecurityPolicy.new configure_defaults end # @api private @@ -116,10 +111,12 @@ @content_security_policy = source.content_security_policy.dup end private :initialize_copy # @api private - def finalize! + def finalize!(app_config) + @base_config.root_directory = app_config.root + # A nil value for `csrf_protection` means it has not been explicitly configured # (neither true nor false), so we can default it to whether sessions are enabled self.csrf_protection = sessions.enabled? if csrf_protection.nil? if content_security_policy