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