Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix formatting of AD::FileHandler and AD::Static doc [ci skip] #29435

Merged
merged 1 commit into from
Jun 13, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 7 additions & 7 deletions actionpack/lib/action_dispatch/middleware/static.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ module ActionDispatch
# When initialized, it can accept optional HTTP headers, which will be set
# when a response containing a file's contents is delivered.
#
# This middleware will render the file specified in `env["PATH_INFO"]`
# This middleware will render the file specified in <tt>env["PATH_INFO"]</tt>
# where the base path is in the +root+ directory. For example, if the +root+
# is set to `public/`, then a request with `env["PATH_INFO"]` of
# `assets/application.js` will return a response with the contents of a file
# located at `public/assets/application.js` if the file exists. If the file
# is set to +public/+, then a request with <tt>env["PATH_INFO"]</tt> of
# +assets/application.js+ will return a response with the contents of a file
# located at +public/assets/application.js+ if the file exists. If the file
# does not exist, a 404 "File not Found" response will be returned.
class FileHandler
def initialize(root, index: "index", headers: {})
Expand All @@ -23,8 +23,8 @@ def initialize(root, index: "index", headers: {})
# correct read permissions, the return value is a URI-escaped string
# representing the filename. Otherwise, false is returned.
#
# Used by the `Static` class to check the existence of a valid file
# in the server's `public/` directory (see Static#call).
# Used by the +Static+ class to check the existence of a valid file
# in the server's +public/+ directory (see Static#call).
def match?(path)
path = ::Rack::Utils.unescape_path path
return false unless ::Rack::Utils.valid_path? path
Expand Down Expand Up @@ -99,7 +99,7 @@ def gzip_file_path(path)
# This middleware will attempt to return the contents of a file's body from
# disk in the response. If a file is not found on disk, the request will be
# delegated to the application stack. This middleware is commonly initialized
# to serve assets from a server's `public/` directory.
# to serve assets from a server's +public/+ directory.
#
# This middleware verifies the path to ensure that only files
# living in the root directory can be rendered. A request cannot
Expand Down