# File lib/mongrel/handlers.rb, line 122 def can_serve(path_info) req_path = File.expand_path(File.join(@path,HttpRequest.unescape(path_info)), @path) if req_path.index(@path) == 0 and File.exist? req_path # it exists and it's in the right location if File.directory? req_path # the request is for a directory index = File.join(req_path, @index_html) if File.exist? index # serve the index return index elsif @listing_allowed # serve the directory return req_path else # do not serve anything return nil end else # it's a file and it's there return req_path end else # does not exist or isn't in the right spot return nil end end