From af73e3cb15c966129221009f1de35dea8de6578e Mon Sep 17 00:00:00 2001 From: Andrew White Date: Fri, 7 Dec 2012 06:02:43 +0000 Subject: Revert "Invert precedence of content in ActionDispatch::Static" This reverts commit c59734f756b79c39486c45273d2cc5d42cd0c864. --- actionpack/lib/action_dispatch/middleware/static.rb | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'actionpack/lib') diff --git a/actionpack/lib/action_dispatch/middleware/static.rb b/actionpack/lib/action_dispatch/middleware/static.rb index 65670b0ff1..e3b15b43b9 100644 --- a/actionpack/lib/action_dispatch/middleware/static.rb +++ b/actionpack/lib/action_dispatch/middleware/static.rb @@ -51,20 +51,16 @@ module ActionDispatch end def call(env) - path = env['PATH_INFO'].chomp('/') - response = @app.call(env) - - if response[1]['X-Cascade'] == 'pass' - case env['REQUEST_METHOD'] - when 'GET', 'HEAD' - if match = @file_handler.match?(path) - env["PATH_INFO"] = match - return @file_handler.call(env) - end + case env['REQUEST_METHOD'] + when 'GET', 'HEAD' + path = env['PATH_INFO'].chomp('/') + if match = @file_handler.match?(path) + env["PATH_INFO"] = match + return @file_handler.call(env) end end - response + @app.call(env) end end end -- cgit v1.2.3