aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorschneems <richard.schneeman@gmail.com>2014-08-05 12:17:03 -0500
committerschneems <richard.schneeman@gmail.com>2014-08-05 12:17:03 -0500
commita9a6423fd654ee2ad8f1c6bfb63bd169880c9a0c (patch)
tree78caa3a9f5895af93e6e151521613db604e8ae67
parent658b40e20713d76699e676a4a5afc818ff26b595 (diff)
downloadrails-a9a6423fd654ee2ad8f1c6bfb63bd169880c9a0c.tar.gz
rails-a9a6423fd654ee2ad8f1c6bfb63bd169880c9a0c.tar.bz2
rails-a9a6423fd654ee2ad8f1c6bfb63bd169880c9a0c.zip
[ci skip] Document ActionDispatch::Static
-rw-r--r--actionpack/lib/action_dispatch/middleware/static.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/actionpack/lib/action_dispatch/middleware/static.rb b/actionpack/lib/action_dispatch/middleware/static.rb
index 7d75cf96f1..25e32cdef8 100644
--- a/actionpack/lib/action_dispatch/middleware/static.rb
+++ b/actionpack/lib/action_dispatch/middleware/static.rb
@@ -55,6 +55,15 @@ module ActionDispatch
end
end
+ # 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.
+ #
+ # This middleware verifies the path to ensure that only files
+ # living in the root directory can be rendered. A request cannot
+ # produce a directory traversal using this middleware. Only 'GET' and 'HEAD'
+ # requests will result in a file being returned.
class Static
def initialize(app, path, cache_control=nil)
@app = app