134: def can_serve(path_info)
135:
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:
140: if File.directory? req_path
141:
142: index = File.join(req_path, @index_html)
143: if File.exist? index
144:
145: return index
146: elsif @listing_allowed
147:
148: return req_path
149: else
150:
151: return nil
152: end
153: else
154:
155: return req_path
156: end
157: else
158:
159: return nil
160: end
161: end