method
handle_file
v2.1.0 -
Show latest stable
- Class:
DispatchServlet
handle_file(req, res)public
No documentation available.
# File railties/lib/webrick_server.rb, line 89
def handle_file(req, res) #:nodoc:
begin
req = req.dup
path = req.path.dup
# Add .html if the last path piece has no . in it
path << '.html' if path != '/' && (%r{(^|/)[^./]+$} =~ path)
path.gsub!('+', ' ') # Unescape + since FileHandler doesn't do so.
req.instance_variable_set(:@path_info, path) # Set the modified path...
@file_handler.send(:service, req, res)
return true
rescue HTTPStatus::PartialContent, HTTPStatus::NotModified => err
res.set_error(err)
return true
rescue => err
return false
end
end