instance method
match?
Ruby on Rails 4.2.9
Since v3.1.12 Last seen in v6.0.6Signature
match?(path)
No documentation comment.
Parameters
-
pathreq
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
Defined in actionpack/lib/action_dispatch/middleware/static.rb line 23
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActionDispatch::FileHandler