Changeset 819
- Timestamp:
- 10/28/07 09:58:07 (11 months ago)
- Files:
-
- tags/rel_1-0-4/lib/mongrel.rb (modified) (1 diff)
- tags/rel_1-0-4/lib/mongrel/handlers.rb (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
tags/rel_1-0-4/lib/mongrel.rb
r741 r819 124 124 REQUEST_PATH='REQUEST_PATH'.freeze 125 125 126 MONGREL_VERSION="1.0. 2".freeze126 MONGREL_VERSION="1.0.4".freeze 127 127 128 128 MONGREL_TMP_BASE="mongrel".freeze tags/rel_1-0-4/lib/mongrel/handlers.rb
r740 r819 127 127 128 128 req_path = HttpRequest.unescape(path_info) 129 if @path 130 req_path = File.expand_path(File.join(@path, path_info), @path) 131 else 132 req_path = File.expand_path(req_path) 133 end 134 135 if req_path.index(@path) == 0 and File.exist? req_path 136 # it exists and it's in the right location 129 # Add the drive letter or root path 130 req_path = File.join(@path, req_path) if @path 131 req_path = File.expand_path req_path 132 133 if File.exist? req_path 134 # It exists and it's in the right location 137 135 if File.directory? req_path 138 # the request is for a directory136 # The request is for a directory 139 137 index = File.join(req_path, @index_html) 140 138 if File.exist? index 141 # serve the index139 # Serve the index 142 140 return index 143 141 elsif @listing_allowed 144 # serve the directory142 # Serve the directory 145 143 return req_path 146 144 else 147 # do not serve anything145 # Do not serve anything 148 146 return nil 149 147 end 150 148 else 151 # it's a file and it's there149 # It's a file and it's there 152 150 return req_path 153 151 end
