mirror of
https://github.com/sinatra/sinatra
synced 2023-03-27 23:18:01 -04:00
Block invalid requests instead of raising error
This commit is contained in:
parent
b2c628b05f
commit
6a6c5f5507
1 changed files with 2 additions and 0 deletions
|
@ -112,6 +112,8 @@ module Rack
|
||||||
valid_token?(env, env['HTTP_X_CSRF_TOKEN']) ||
|
valid_token?(env, env['HTTP_X_CSRF_TOKEN']) ||
|
||||||
valid_token?(env, Request.new(env).params[options[:authenticity_param]]) ||
|
valid_token?(env, Request.new(env).params[options[:authenticity_param]]) ||
|
||||||
( options[:allow_if] && options[:allow_if].call(env) )
|
( options[:allow_if] && options[:allow_if].call(env) )
|
||||||
|
rescue
|
||||||
|
false
|
||||||
end
|
end
|
||||||
|
|
||||||
def mask_authenticity_token(session, path: nil, method: :post)
|
def mask_authenticity_token(session, path: nil, method: :post)
|
||||||
|
|
Loading…
Reference in a new issue