module Roda::RodaPlugins::ContentSecurityPolicy::ResponseMethods

def content_security_policy

The current content security policy to be used for this response.

def content_security_policy
  @content_security_policy ||= roda_class.opts[:content_security_policy].dup
end

def initialize

Unset any content security policy when reinitializing

def initialize
  super
  @content_security_policy &&= nil
end

def set_default_headers

Set the appropriate content security policy header.

def set_default_headers
  super
  (@content_security_policy || roda_class.opts[:content_security_policy]).set_header(headers)
end