class Rack::Directory

def list_path(env, path, path_info, script_name)

Unreadable and non-file, non-directory entries will get a 404 response.
Rack response to use for files and directories under the root.
def list_path(env, path, path_info, script_name)
  if (stat = stat(path)) && stat.readable?
    return @app.call(env) if stat.file?
    return list_directory(path_info, path, script_name) if stat.directory?
  end
  entity_not_found(path_info)
end