diff options
author | schneems <richard.schneeman@gmail.com> | 2014-08-05 12:17:03 -0500 |
---|---|---|
committer | schneems <richard.schneeman@gmail.com> | 2014-08-05 12:17:03 -0500 |
commit | a9a6423fd654ee2ad8f1c6bfb63bd169880c9a0c (patch) | |
tree | 78caa3a9f5895af93e6e151521613db604e8ae67 /actionpack | |
parent | 658b40e20713d76699e676a4a5afc818ff26b595 (diff) | |
download | rails-a9a6423fd654ee2ad8f1c6bfb63bd169880c9a0c.tar.gz rails-a9a6423fd654ee2ad8f1c6bfb63bd169880c9a0c.tar.bz2 rails-a9a6423fd654ee2ad8f1c6bfb63bd169880c9a0c.zip |
[ci skip] Document ActionDispatch::Static
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/lib/action_dispatch/middleware/static.rb | 9 |
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 |