Class: Rack::Protection::RemoteReferrer

### Home Classes Methods

### In Files

- lib/rack/protection/remote_referrer.rb

### Parent

Rack::Protection::Base

### Methods

- #accepts?

### Class/Module Index

Quicksearch

- Rack
- Rack::Protection
- Rack::Protection::AuthenticityToken
- Rack::Protection::Base
- Rack::Protection::EscapedParams
- Rack::Protection::FormToken
- Rack::Protection::FrameOptions
- Rack::Protection::HttpOrigin
- Rack::Protection::IPSpoofing
- Rack::Protection::JsonCsrf
- Rack::Protection::PathTraversal
- Rack::Protection::RemoteReferrer
- Rack::Protection::RemoteToken
- Rack::Protection::SessionHijacking
- Rack::Protection::VERSION
- Rack::Protection::XSSHeader

No matching classes.

# Rack::Protection::RemoteReferrer

Prevented attack | CSRF
Supported browsers | all
More infos | 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.

### Public Instance Methods

accepts?(env) click to toggle source

    # File lib/rack/protection/remote_referrer.rb, line 15
    def accepts?(env)
      safe?(env) or referrer(env) == Request.new(env).host
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.