public Method

DispatchServlet.handle_file(req, res)

There's no documentation for this item.

Source Code

# File webrick_server.rb, line 90
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
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.