instance method
find_file
Ruby on Rails 7.2.3
Since v6.1.7.10 PrivateSignature
find_file(path_info, accept_encoding:)
Match a URI path to a static file to be served.
Used by the Static class to negotiate a servable file in the public/ directory (see Static#call).
Checks for path, path.html, and path/index.html files, in that order, including .br and .gzip compressed extensions.
If a matching file is found, the path and necessary response headers (Content-Type, Content-Encoding) are returned.
Parameters
-
path_inforeq -
accept_encodingkeyreq
Source
# File actionpack/lib/action_dispatch/middleware/static.rb, line 104
def find_file(path_info, accept_encoding:)
each_candidate_filepath(path_info) do |filepath, content_type|
if response = try_files(filepath, content_type, accept_encoding: accept_encoding)
return response
end
end
end
Defined in actionpack/lib/action_dispatch/middleware/static.rb line 104
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActionDispatch::FileHandler