# File lib/mongrel.rb, line 470 470: def can_serve(path_info) 471: req = File.expand_path(File.join(@path,path_info), @path) 472: 473: if req.index(@path) == 0 and File.exist? req 474: # it exists and it's in the right location 475: if File.directory? req 476: # the request is for a directory 477: index = File.join(req, @index_html) 478: if File.exist? index 479: # serve the index 480: return index 481: elsif @listing_allows 482: # serve the directory 483: req 484: else 485: # do not serve anything 486: return nil 487: end 488: else 489: # it's a file and it's there 490: return req 491: end 492: else 493: # does not exist or isn't in the right spot 494: return nil 495: end 496: end