Skip to content

Commit

Permalink
Block invalid requests instead of raising error
Browse files Browse the repository at this point in the history
  • Loading branch information
jkowens committed Feb 2, 2022
1 parent f6cee1c commit 759a8eb
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions rack-protection/lib/rack/protection/authenticity_token.rb
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ def accepts?(env)
valid_token?(env, env['HTTP_X_CSRF_TOKEN']) ||
valid_token?(env, Request.new(env).params[options[:authenticity_param]]) ||
( options[:allow_if] && options[:allow_if].call(env) )
rescue
false
end

def mask_authenticity_token(session, path: nil, method: :post)
Expand Down

0 comments on commit 759a8eb

Please sign in to comment.