Skip to content

Commit 7b2a09f

Browse files
committed
fix rake serve
1 parent d9db7e3 commit 7b2a09f

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

config.ru

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,11 @@ module Rack
3030
return entity_not_found(path_info)
3131
end
3232

33-
def list_path
33+
def list_path(env = @env, path = @path, path_info = @path_info, script_name = @script_name)
34+
@env = env
35+
@path = path
36+
@path_info = path_info
37+
@script_name = script_name
3438
@stat = ::File.stat(@path)
3539

3640
if @stat.readable?
@@ -41,15 +45,15 @@ module Rack
4145
@env['PATH_INFO'] = @env['PATH_INFO'].sub(/\/?$/, '/index.html')
4246
return @app.call(@env)
4347
else
44-
return list_directory
48+
return list_directory(@path_info, @path, @script_name)
4549
end
4650
end
4751
else
4852
raise Errno::ENOENT, 'No such file or directory'
4953
end
5054

5155
rescue Errno::ENOENT, Errno::ELOOP
52-
return entity_not_found
56+
return entity_not_found(@path_info)
5357
end
5458

5559
end

0 commit comments

Comments
 (0)