aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/metal
diff options
context:
space:
mode:
authorVille Lautanala <lautis@gmail.com>2015-02-12 22:24:45 +0200
committerVille Lautanala <lautis@gmail.com>2015-02-12 22:24:45 +0200
commitbf067b41e58409240a0370993069eb8820ca12a6 (patch)
tree36571121236d56e9649e3451890890df7e99aa32 /actionpack/lib/action_controller/metal
parentfa63448420d3385dbd043aca22dba973b45b8bb2 (diff)
downloadrails-bf067b41e58409240a0370993069eb8820ca12a6.tar.gz
rails-bf067b41e58409240a0370993069eb8820ca12a6.tar.bz2
rails-bf067b41e58409240a0370993069eb8820ca12a6.zip
Handle non-string authenticity tokens
Non-string authenticity tokens raised NoMethodError when decoding the masked token.
Diffstat (limited to 'actionpack/lib/action_controller/metal')
-rw-r--r--actionpack/lib/action_controller/metal/request_forgery_protection.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/actionpack/lib/action_controller/metal/request_forgery_protection.rb b/actionpack/lib/action_controller/metal/request_forgery_protection.rb
index 7facbe79aa..7a7e2431b2 100644
--- a/actionpack/lib/action_controller/metal/request_forgery_protection.rb
+++ b/actionpack/lib/action_controller/metal/request_forgery_protection.rb
@@ -279,7 +279,7 @@ module ActionController #:nodoc:
begin
masked_token = Base64.strict_decode64(encoded_masked_token)
- rescue ArgumentError # encoded_masked_token is invalid Base64
+ rescue ArgumentError, NoMethodError # encoded_masked_token is invalid Base64
return false
end