Sha256: 774c2b55f5907b639d2d7fce933e1c1119ebd5b5ddde9ac1e69e3c34fd4235d5

Contents?: true

Size: 720 Bytes

Versions: 32

Compression:

Stored size: 720 Bytes

Contents

module ActionDispatch
  module Http
    module FilterRedirect

      FILTERED = '[FILTERED]'.freeze # :nodoc:

      def filtered_location
        if !location_filter.empty? && location_filter_match?
          FILTERED
        else
          location
        end
      end

    private

      def location_filter
        if request.present?
          request.env['action_dispatch.redirect_filter'] || []
        else
          []
        end
      end

      def location_filter_match?
        location_filter.any? do |filter|
          if String === filter
            location.include?(filter)
          elsif Regexp === filter
            location.match(filter)
          end
        end
      end

    end
  end
end

Version data entries

32 entries across 32 versions & 2 rubygems

Version Path
actionpack-4.0.13 lib/action_dispatch/http/filter_redirect.rb
actionpack-4.0.13.rc1 lib/action_dispatch/http/filter_redirect.rb
actionpack-4.0.11.1 lib/action_dispatch/http/filter_redirect.rb
actionpack-4.0.12 lib/action_dispatch/http/filter_redirect.rb
actionpack-4.0.11 lib/action_dispatch/http/filter_redirect.rb
actionpack-4.0.10 lib/action_dispatch/http/filter_redirect.rb
actionpack-4.0.10.rc2 lib/action_dispatch/http/filter_redirect.rb
actionpack-4.0.10.rc1 lib/action_dispatch/http/filter_redirect.rb
actionpack-4.0.9 lib/action_dispatch/http/filter_redirect.rb
actionpack-4.0.8 lib/action_dispatch/http/filter_redirect.rb
actionpack-4.0.7 lib/action_dispatch/http/filter_redirect.rb
actionpack-4.0.6 lib/action_dispatch/http/filter_redirect.rb
actionpack-4.0.6.rc3 lib/action_dispatch/http/filter_redirect.rb
actionpack-4.0.6.rc2 lib/action_dispatch/http/filter_redirect.rb
actionpack-4.0.6.rc1 lib/action_dispatch/http/filter_redirect.rb
actionpack-4.0.5 lib/action_dispatch/http/filter_redirect.rb
actionpack-4.0.4 lib/action_dispatch/http/filter_redirect.rb
actionpack-4.0.4.rc1 lib/action_dispatch/http/filter_redirect.rb
actionpack-4.1.0.beta2 lib/action_dispatch/http/filter_redirect.rb
actionpack-4.0.3 lib/action_dispatch/http/filter_redirect.rb