method
match?
v4.2.1 -
Show latest stable
- Class:
ActionDispatch::FileHandler
match?(path)public
No documentation available.
# File actionpack/lib/action_dispatch/middleware/static.rb, line 23
def match?(path)
path = URI.parser.unescape(path)
return false unless path.valid_encoding?
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)
begin
File.file?(path) && File.readable?(path)
rescue SystemCallError
false
end
}
return ::Rack::Utils.escape(match)
end
end