method

match?

Importance_0
v4.2.7 - Show latest stable - 0 notes - Class: FileHandler
match?(path) public

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File actionpack/lib/action_dispatch/middleware/static.rb, line 23
    def match?(path)
      path = URI.parser.unescape(path)
      return false unless valid_path?(path)

      paths = [path, "#{path}#{ext}", "#{path}/index#{ext}"].map { |v|
        Rack::Utils.clean_path_info v
      }

      if match = paths.detect { |p|
        path = File.join(@root, p.force_encoding('UTF-8'))
        begin
          File.file?(path) && File.readable?(path)
        rescue SystemCallError
          false
        end

      }
        return ::Rack::Utils.escape(match)
      end
    end
Register or log in to add new notes.