123456789_123456789_123456789_123456789_123456789_

Class: Rack::Protection::RemoteToken

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
Instance Chain:
Inherits: Rack::Protection::AuthenticityToken
Defined in: rack-protection/lib/rack/protection/remote_token.rb

Overview

Prevented attack:: CSRF Supported browsers:: all More infos:: http://en.wikipedia.org/wiki/Cross-site_request_forgery

Only accepts unsafe HTTP requests if a given access token matches the token included in the session or the request comes from the same origin.

Compatible with rack-csrf.

Constant Summary

Base - Inherited

DEFAULT_OPTIONS

AuthenticityToken - Inherited

GLOBAL_TOKEN_IDENTIFIER, TOKEN_LENGTH

Class Method Summary

Instance Attribute Summary

Base - Inherited

Instance Method Summary

Constructor Details

This class inherits a constructor from Rack::Protection::Base

Instance Method Details

#accepts?(env) ⇒ Boolean

[ GitHub ]

  
# File 'rack-protection/lib/rack/protection/remote_token.rb', line 19

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