class Rack::Files

Rack::Files serves files below the root directory given, according to the path info of the Rack request. e.g. when Rack::Files.new(“/etc”) is used, you can access ‘passwd’ file as localhost:9292/passwd

Handlers can detect if bodies are a Rack::Files, and use mechanisms like sendfile on the path.

Be aware that just like the default behavior of most webservers, Rack::Files will follow symbolic links encountered under the root. If a symlink points to a location outside of the root, that target will still be served as part of the response.