# File lib/rack/file.rb, line 22 def _call(env) if env["PATH_INFO"].include? ".." return [403, {"Content-Type" => "text/plain"}, ["Forbidden\n"]] end @path = F.join(@root, Utils.unescape(env["PATH_INFO"])) ext = F.extname(@path)[1..-1] if F.file?(@path) && F.readable?(@path) [200, { "Last-Modified" => F.mtime(@path).rfc822, "Content-Type" => MIME_TYPES[ext] || "text/plain", "Content-Length" => F.size(@path).to_s }, self] else return [404, {"Content-Type" => "text/plain"}, ["File not found: #{env["PATH_INFO"]}\n"]] end end