Servlet for serving a single file. You probably want to use the FileHandler
servlet instead as it handles directories and fancy indexes.
Example:
server.mount('/my_page.txt', WEBrick::HTTPServlet::DefaultFileHandler, '/path/to/my_page.txt')
This servlet handles If-Modified-Since and Range
requests.
Class Methods
lib/webrick/httpservlet/filehandler.rb
View on GitHub
# File tmp/rubies/ruby-2.5.9/lib/webrick/httpservlet/filehandler.rb, line 37
def initialize(server, local_path)
super(server, local_path)
@local_path = local_path
end
Creates a DefaultFileHandler
instance for the file at local_path
.