diff options
author | Santiago Pastorino <santiago@wyeworks.com> | 2015-06-02 14:22:09 -0300 |
---|---|---|
committer | Santiago Pastorino <santiago@wyeworks.com> | 2015-06-02 14:22:09 -0300 |
commit | 4519727cdb4a2e55aceefcc41f16b2c1da0d1681 (patch) | |
tree | 71b40f1747216abef512278c3254259368035f86 /actionpack | |
parent | 939d5a493217bf5fa966495bc80440eeb0dbc29f (diff) | |
parent | b7b75e07945a10f5018eea04544c1f5005e09628 (diff) | |
download | rails-4519727cdb4a2e55aceefcc41f16b2c1da0d1681.tar.gz rails-4519727cdb4a2e55aceefcc41f16b2c1da0d1681.tar.bz2 rails-4519727cdb4a2e55aceefcc41f16b2c1da0d1681.zip |
Merge pull request #20383 from jonatack/fix-configurable-static-index-filename
Fix regression in #20017 wrong number of arguments error
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/lib/action_dispatch/middleware/static.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/actionpack/lib/action_dispatch/middleware/static.rb b/actionpack/lib/action_dispatch/middleware/static.rb index f20f6ca865..3aa0eef4ad 100644 --- a/actionpack/lib/action_dispatch/middleware/static.rb +++ b/actionpack/lib/action_dispatch/middleware/static.rb @@ -13,7 +13,7 @@ module ActionDispatch # 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, cache_control, index) + def initialize(root, cache_control, index = 'index') @root = root.chomp('/') @compiled_root = /^#{Regexp.escape(root)}/ headers = cache_control && { 'Cache-Control' => cache_control } @@ -105,7 +105,7 @@ module ActionDispatch # 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, index="index") + def initialize(app, path, cache_control = nil, index = 'index') @app = app @file_handler = FileHandler.new(path, cache_control, index) end @@ -115,7 +115,7 @@ module ActionDispatch when 'GET', 'HEAD' path = env['PATH_INFO'].chomp('/') if match = @file_handler.match?(path) - env["PATH_INFO"] = match + env['PATH_INFO'] = match return @file_handler.call(env) end end |