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
  unless @skip_content_security_policy
    (@content_security_policy || roda_class.opts[:content_security_policy]).set_header(headers)
  end
end

def skip_content_security_policy!

Do not set a content security policy header for this response.
def skip_content_security_policy!
  @skip_content_security_policy = true
end