summary refs log tree commit
path: root/lib/rack/file.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rack/file.rb')
-rw-r--r--lib/rack/file.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/rack/file.rb b/lib/rack/file.rb
index 227a7284..0a257b3d 100644
--- a/lib/rack/file.rb
+++ b/lib/rack/file.rb
@@ -38,8 +38,9 @@ module Rack
       end
 
       path_info = Utils.unescape_path request.path_info
-      clean_path_info = Utils.clean_path_info(path_info)
+      return fail(400, "Bad Request") unless Utils.valid_path?(path_info)
 
+      clean_path_info = Utils.clean_path_info(path_info)
       path = ::File.join(@root, clean_path_info)
 
       available = begin