diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2014-01-31 12:00:54 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2014-01-31 12:00:54 -0800 |
commit | e8fcd599ba6a301dbddb084f7369320ca3c49ff3 (patch) | |
tree | dcfe2c617e89cc9d9dbaf7ddc9029c5771e27d9e | |
parent | 0b101804444e2cc57740b1c79cbd19f340f46cbf (diff) | |
download | rails-e8fcd599ba6a301dbddb084f7369320ca3c49ff3.tar.gz rails-e8fcd599ba6a301dbddb084f7369320ca3c49ff3.tar.bz2 rails-e8fcd599ba6a301dbddb084f7369320ca3c49ff3.zip |
only ask for the location filters once
-rw-r--r-- | actionpack/lib/action_dispatch/http/filter_redirect.rb | 9 | ||||
-rw-r--r-- | actionview/lib/action_view.rb | 4 |
2 files changed, 7 insertions, 6 deletions
diff --git a/actionpack/lib/action_dispatch/http/filter_redirect.rb b/actionpack/lib/action_dispatch/http/filter_redirect.rb index 900ce1c646..cd603649c3 100644 --- a/actionpack/lib/action_dispatch/http/filter_redirect.rb +++ b/actionpack/lib/action_dispatch/http/filter_redirect.rb @@ -5,7 +5,8 @@ module ActionDispatch FILTERED = '[FILTERED]'.freeze # :nodoc: def filtered_location - if !location_filter.empty? && location_filter_match? + filters = location_filter + if !filters.empty? && location_filter_match?(filters) FILTERED else location @@ -15,15 +16,15 @@ module ActionDispatch private def location_filter - if request.present? + if request request.env['action_dispatch.redirect_filter'] || [] else [] end end - def location_filter_match? - location_filter.any? do |filter| + def location_filter_match?(filters) + filters.any? do |filter| if String === filter location.include?(filter) elsif Regexp === filter diff --git a/actionview/lib/action_view.rb b/actionview/lib/action_view.rb index 5c729345dc..0eb29b7ebb 100644 --- a/actionview/lib/action_view.rb +++ b/actionview/lib/action_view.rb @@ -28,6 +28,8 @@ require 'action_view/version' module ActionView extend ActiveSupport::Autoload + ENCODING_FLAG = '#.*coding[:=]\s*(\S+)[ \t]*' + eager_autoload do autoload :Base autoload :Context @@ -81,8 +83,6 @@ module ActionView autoload :TestCase - ENCODING_FLAG = '#.*coding[:=]\s*(\S+)[ \t]*' - def self.eager_load! super ActionView::Helpers.eager_load! |