Sha256: 3323ee13042a0fdb9bf23178ab004994fd182e3cac199d19b935e83edca45659
Contents?: true
Size: 604 Bytes
Versions: 155
Compression:
Stored size: 604 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 # # 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 Rails and rack-csrf. class RemoteToken < AuthenticityToken default_reaction :deny def accepts?(env) super or referrer(env) == Request.new(env).host end end end end
Version data entries
155 entries across 150 versions & 25 rubygems