class CSPEasy

Public Class Methods

new(app, policy="") click to toggle source
# File lib/csp_easy.rb, line 2
def initialize(app, policy="")
  @app = app
  @policy = policy
end

Public Instance Methods

_call(env) click to toggle source
# File lib/csp_easy.rb, line 11
def _call(env)
  @status, @headers, @response = @app.call(env)
  @headers["X-Content-Security-Policy"] = @policy unless @policy.blank?
  [@status, @headers, self]
end
call(env) click to toggle source
# File lib/csp_easy.rb, line 7
def call(env)
  dup._call(env)
end
each(&block) click to toggle source
# File lib/csp_easy.rb, line 17
def each(&block)
  @response.each(&block)
end