Sha256: 9d204035a25bc032e9f876fc99d57e677af7e625e5f4ae3547954bef908df0bc

Contents?: true

Size: 498 Bytes

Versions: 121

Compression:

Stored size: 498 Bytes

Contents

require 'rack/protection'

module Rack
  module Protection
    ##
    # Prevented attack::   CSRF
    # Supported browsers:: all
    # More infos::         http://en.wikipedia.org/wiki/Cross-site_request_forgery
    #
    # Does not accept unsafe HTTP requests if the Referer [sic] header is set to
    # a different host.
    class RemoteReferrer < Base
      default_reaction :deny

      def accepts?(env)
        safe?(env) or referrer(env) == Request.new(env).host
      end
    end
  end
end

Version data entries

121 entries across 112 versions & 24 rubygems

Version Path
logstash-output-scalyr-0.1.18.beta vendor/bundle/jruby/2.5.0/gems/rack-protection-1.5.5/lib/rack/protection/remote_referrer.rb
logstash-output-scalyr-0.1.17.beta vendor/bundle/jruby/2.5.0/gems/rack-protection-1.5.5/lib/rack/protection/remote_referrer.rb
logstash-output-scalyr-0.1.16.beta vendor/bundle/jruby/2.5.0/gems/rack-protection-1.5.5/lib/rack/protection/remote_referrer.rb
logstash-output-scalyr-0.1.15.beta vendor/bundle/jruby/2.5.0/gems/rack-protection-1.5.5/lib/rack/protection/remote_referrer.rb
logstash-output-scalyr-0.1.14.beta vendor/bundle/jruby/2.5.0/gems/rack-protection-1.5.5/lib/rack/protection/remote_referrer.rb
logstash-output-scalyr-0.1.13 vendor/bundle/jruby/2.5.0/gems/rack-protection-1.5.5/lib/rack/protection/remote_referrer.rb
logstash-output-scalyr-0.1.12 vendor/bundle/jruby/2.5.0/gems/rack-protection-1.5.5/lib/rack/protection/remote_referrer.rb
logstash-output-scalyr-0.1.11.beta vendor/bundle/jruby/2.5.0/gems/rack-protection-1.5.5/lib/rack/protection/remote_referrer.rb
logstash-output-scalyr-0.1.10.beta vendor/bundle/jruby/2.5.0/gems/rack-protection-1.5.5/lib/rack/protection/remote_referrer.rb
logstash-output-scalyr-0.1.9 vendor/bundle/jruby/2.5.0/gems/rack-protection-1.5.5/lib/rack/protection/remote_referrer.rb
logstash-output-scalyr-0.1.8 vendor/bundle/jruby/2.5.0/gems/rack-protection-1.5.5/lib/rack/protection/remote_referrer.rb
logstash-output-scalyr-0.1.7 vendor/bundle/jruby/2.5.0/gems/rack-protection-1.5.5/lib/rack/protection/remote_referrer.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/rack-protection-2.1.0/lib/rack/protection/remote_referrer.rb
logstash-output-scalyr-0.1.6 vendor/bundle/jruby/2.5.0/gems/rack-protection-1.5.5/lib/rack/protection/remote_referrer.rb
logstash-output-newrelic-1.2.0 vendor/bundle/jruby/2.5.0/gems/rack-protection-1.5.5/lib/rack/protection/remote_referrer.rb
rack-protection-2.1.0 lib/rack/protection/remote_referrer.rb
logstash-filter-csharp-0.2.1 vendor/bundle/jruby/2.5.0/gems/rack-protection-1.5.5/lib/rack/protection/remote_referrer.rb
logstash-filter-csharp-0.2.1 vendor/bundle/jruby/2.3.0/gems/rack-protection-1.5.3/lib/rack/protection/remote_referrer.rb
logstash-filter-csharp-0.2.0 vendor/bundle/jruby/2.3.0/gems/rack-protection-1.5.3/lib/rack/protection/remote_referrer.rb
logstash-filter-csharp-0.2.0 vendor/bundle/jruby/2.5.0/gems/rack-protection-1.5.5/lib/rack/protection/remote_referrer.rb