aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/metal/http_authentication.rb
diff options
context:
space:
mode:
authorLarry Lv <larrylv1990@gmail.com>2014-06-13 14:19:53 +0800
committerLarry Lv <larrylv1990@gmail.com>2014-06-13 16:29:15 +0800
commitfdb10597952614456b45460202c0b7c7b8833ecd (patch)
treed138b0e9d3b1a6b5e25347af8316c907e3ac25b2 /actionpack/lib/action_controller/metal/http_authentication.rb
parent9a0c2e5c626cfbde527013bd0cfcec682baa48fa (diff)
downloadrails-fdb10597952614456b45460202c0b7c7b8833ecd.tar.gz
rails-fdb10597952614456b45460202c0b7c7b8833ecd.tar.bz2
rails-fdb10597952614456b45460202c0b7c7b8833ecd.zip
Fix parsed token value with header `Authorization token=`.
Diffstat (limited to 'actionpack/lib/action_controller/metal/http_authentication.rb')
-rw-r--r--actionpack/lib/action_controller/metal/http_authentication.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/actionpack/lib/action_controller/metal/http_authentication.rb b/actionpack/lib/action_controller/metal/http_authentication.rb
index bad979be2d..5b52c19802 100644
--- a/actionpack/lib/action_controller/metal/http_authentication.rb
+++ b/actionpack/lib/action_controller/metal/http_authentication.rb
@@ -449,7 +449,7 @@ module ActionController
authorization_request = request.authorization.to_s
if authorization_request[TOKEN_REGEX]
params = token_params_from authorization_request
- [params.shift.last, Hash[params].with_indifferent_access]
+ [params.shift[1], Hash[params].with_indifferent_access]
end
end
@@ -464,7 +464,7 @@ module ActionController
# This removes the `"` characters wrapping the value.
def rewrite_param_values(array_params)
- array_params.each { |param| param.last.gsub! %r/^"|"$/, '' }
+ array_params.each { |param| (param[1] || "").gsub! %r/^"|"$/, '' }
end
# This method takes an authorization body and splits up the key-value