module ActionDispatch::Http::FilterRedirect

Public Instance Methods

filtered_location() click to toggle source
# File lib/action_dispatch/http/filter_redirect.rb, line 7
def filtered_location
  if !location_filter.empty? && location_filter_match?
    FILTERED
  else
    location
  end
end

Private Instance Methods

location_filter() click to toggle source
# File lib/action_dispatch/http/filter_redirect.rb, line 17
def location_filter
  if request.present?
    request.env['action_dispatch.redirect_filter'] || []
  else
    []
  end
end
location_filter_match?() click to toggle source
# File lib/action_dispatch/http/filter_redirect.rb, line 25
def location_filter_match?
  location_filter.any? do |filter|
    if String === filter
      location.include?(filter)
    elsif Regexp === filter
      location.match(filter)
    end
  end
end