122: def can_serve(path_info)
123: req_path = File.expand_path(File.join(@path,HttpRequest.unescape(path_info)), @path)
124:
125: if req_path.index(@path) == 0 and File.exist? req_path
126:
127: if File.directory? req_path
128:
129: index = File.join(req_path, @index_html)
130: if File.exist? index
131:
132: return index
133: elsif @listing_allowed
134:
135: return req_path
136: else
137:
138: return nil
139: end
140: else
141:
142: return req_path
143: end
144: else
145:
146: return nil
147: end
148: end