Changeset 819

Show
Ignore:
Timestamp:
10/28/07 09:58:07 (11 months ago)
Author:
evanweaver
Message:

handlers fix and versions fix backported to 1.0.4

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • tags/rel_1-0-4/lib/mongrel.rb

    r741 r819  
    124124    REQUEST_PATH='REQUEST_PATH'.freeze 
    125125 
    126     MONGREL_VERSION="1.0.2".freeze 
     126    MONGREL_VERSION="1.0.4".freeze 
    127127 
    128128    MONGREL_TMP_BASE="mongrel".freeze 
  • tags/rel_1-0-4/lib/mongrel/handlers.rb

    r740 r819  
    127127 
    128128      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 
    137135        if File.directory? req_path 
    138           # the request is for a directory 
     136          # The request is for a directory 
    139137          index = File.join(req_path, @index_html) 
    140138          if File.exist? index 
    141             # serve the index 
     139            # Serve the index 
    142140            return index 
    143141          elsif @listing_allowed 
    144             # serve the directory 
     142            # Serve the directory 
    145143            return req_path 
    146144          else 
    147             # do not serve anything 
     145            # Do not serve anything 
    148146            return nil 
    149147          end 
    150148        else 
    151           # it's a file and it's there 
     149          # It's a file and it's there 
    152150          return req_path 
    153151        end