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