diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-12-16 17:05:16 -0200 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-12-16 17:05:16 -0200 |
commit | 4b669dbb9180c7f9740bc24dea403b82c8d6ddc9 (patch) | |
tree | 3ccc754c7bf487be10b7e07f8226b6df502e890e /actionpack/lib | |
parent | 97e413002639c1e19503f9c9875fc83428c36f51 (diff) | |
parent | b1c19eb05299fbae2a80beb4abacacc4b5340776 (diff) | |
download | rails-4b669dbb9180c7f9740bc24dea403b82c8d6ddc9.tar.gz rails-4b669dbb9180c7f9740bc24dea403b82c8d6ddc9.tar.bz2 rails-4b669dbb9180c7f9740bc24dea403b82c8d6ddc9.zip |
Merge branch 'master' into merge-action-cable
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/abstract_controller/callbacks.rb | 3 | ||||
-rw-r--r-- | actionpack/lib/action_controller/caching/fragments.rb | 2 | ||||
-rw-r--r-- | actionpack/lib/action_controller/metal/http_authentication.rb | 2 |
3 files changed, 4 insertions, 3 deletions
diff --git a/actionpack/lib/abstract_controller/callbacks.rb b/actionpack/lib/abstract_controller/callbacks.rb index d5317e4717..d63ce9c1c3 100644 --- a/actionpack/lib/abstract_controller/callbacks.rb +++ b/actionpack/lib/abstract_controller/callbacks.rb @@ -48,7 +48,8 @@ module AbstractController def _normalize_callback_option(options, from, to) # :nodoc: if from = options[from] - from = Array(from).map {|o| "action_name == '#{o}'"}.join(" || ") + _from = Array(from).map(&:to_s).to_set + from = proc {|c| _from.include? c.action_name } options[to] = Array(options[to]).unshift(from) end end diff --git a/actionpack/lib/action_controller/caching/fragments.rb b/actionpack/lib/action_controller/caching/fragments.rb index c42384b741..b9ad51a9cf 100644 --- a/actionpack/lib/action_controller/caching/fragments.rb +++ b/actionpack/lib/action_controller/caching/fragments.rb @@ -62,7 +62,7 @@ module ActionController # with the specified +key+ value. The key is expanded using # ActiveSupport::Cache.expand_cache_key. def fragment_cache_key(key) - head = self.class.fragment_cache_keys.map { |key| instance_exec(&key) } + head = self.class.fragment_cache_keys.map { |k| instance_exec(&k) } tail = key.is_a?(Hash) ? url_for(key).split("://").last : key ActiveSupport::Cache.expand_cache_key([*head, *tail], :views) end diff --git a/actionpack/lib/action_controller/metal/http_authentication.rb b/actionpack/lib/action_controller/metal/http_authentication.rb index 0a36fecd27..2ac6e37e34 100644 --- a/actionpack/lib/action_controller/metal/http_authentication.rb +++ b/actionpack/lib/action_controller/metal/http_authentication.rb @@ -397,7 +397,7 @@ module ActionController # RewriteRule ^(.*)$ dispatch.fcgi [E=X-HTTP_AUTHORIZATION:%{HTTP:Authorization},QSA,L] module Token TOKEN_KEY = 'token=' - TOKEN_REGEX = /^(Token|Bearer) / + TOKEN_REGEX = /^(Token|Bearer)\s+/ AUTHN_PAIR_DELIMITERS = /(?:,|;|\t+)/ extend self |