Sha256: f88fd06098525b2f7a6976328dad3b42f140a3b23e89bd2107d10bee333c07a5
Contents?: true
Size: 616 Bytes
Versions: 21
Compression:
Stored size: 616 Bytes
Contents
module SecureHeaders class ContentSecurityPolicy class ScriptHashMiddleware def initialize(app) @app = app end def call(env) status, headers, response = @app.call(env) metadata = env[ContentSecurityPolicy::ENV_KEY] if !metadata.nil? config, options = metadata.values_at(:config, :options) config.merge!(:script_hashes => env[HASHES_ENV_KEY]) csp_header = ContentSecurityPolicy.new(config, options) headers[csp_header.name] = csp_header.value end [status, headers, response] end end end end
Version data entries
21 entries across 21 versions & 1 rubygems