Sha256: a51173d3d86acd242bf9b67726e9c4ddabc06182e2ee8dcced00e1bff97416a1
Contents?: true
Size: 834 Bytes
Versions: 3
Compression:
Stored size: 834 Bytes
Contents
# frozen_string_literal: true require 'rack/protection' module Rack module Protection ## # Prevented attack:: Secret leakage, third party tracking # Supported browsers:: mixed support # More infos:: https://www.w3.org/TR/referrer-policy/ # https://caniuse.com/#search=referrer-policy # # Sets Referrer-Policy header to tell the browser to limit the Referer header. # # Options: # referrer_policy:: The policy to use (default: 'strict-origin-when-cross-origin') class ReferrerPolicy < Base default_options referrer_policy: 'strict-origin-when-cross-origin' def call(env) status, headers, body = @app.call(env) headers['referrer-policy'] ||= options[:referrer_policy] [status, headers, body] end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
rack-protection-4.1.1 | lib/rack/protection/referrer_policy.rb |
rack-protection-4.1.0 | lib/rack/protection/referrer_policy.rb |
rack-protection-4.0.0 | lib/rack/protection/referrer_policy.rb |