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