# File lib/mongrel/handlers.rb, line 132
132:     def can_serve(path_info)
133:       # TODO: investigate freezing the path_info to prevent double escaping
134:       req_path = File.expand_path(File.join(@path,HttpRequest.unescape(path_info)), @path)
135: 
136:       if req_path.index(@path) == 0 and File.exist? req_path
137:         # it exists and it's in the right location
138:         if File.directory? req_path
139:           # the request is for a directory
140:           index = File.join(req_path, @index_html)
141:           if File.exist? index
142:             # serve the index
143:             return index
144:           elsif @listing_allowed
145:             # serve the directory
146:             return req_path
147:           else
148:             # do not serve anything
149:             return nil
150:           end
151:         else
152:           # it's a file and it's there
153:           return req_path
154:         end
155:       else
156:         # does not exist or isn't in the right spot
157:         return nil
158:       end
159:     end