Browse files

only ask for the location filters once

  • Loading branch information...
1 parent 0b10180 commit e8fcd599ba6a301dbddb084f7369320ca3c49ff3 @tenderlove tenderlove committed Jan 31, 2014
Showing with 7 additions and 6 deletions.
  1. +5 −4 actionpack/lib/action_dispatch/http/filter_redirect.rb
  2. +2 −2 actionview/lib/action_view.rb
View
9 actionpack/lib/action_dispatch/http/filter_redirect.rb
@@ -5,7 +5,8 @@ module FilterRedirect
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 @@ def filtered_location
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
View
4 actionview/lib/action_view.rb
@@ -28,6 +28,8 @@
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!

0 comments on commit e8fcd59

Please sign in to comment.