Changeset 827

Show
Ignore:
Timestamp:
10/29/07 00:38:01 (10 months ago)
Author:
evanweaver
Message:

backport

Files:

Legend:

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

    r819 r827  
    7070 
    7171 
     72  # 
    7273  # The server normally returns a 404 response if an unknown URI is requested, but it 
    7374  # also returns a lame empty message.  This lets you do a 404 response 
    7475  # with a custom message for special URIs. 
     76  # 
    7577  class Error404Handler < HttpHandler 
    7678 
     
    8890  end 
    8991 
    90  
     92  # 
    9193  # Serves the contents of a directory.  You give it the path to the root 
    9294  # where the files are located, and it tries to find the files based on  
     
    9597  # 
    9698  # It does a simple protection against going outside it's root path by 
    97   # converting all paths to an absolute expanded path, and then making sure 
    98   # that the final expanded path includes the root path.  If it doesn't 
     99  # converting all paths to an absolute expanded path, and then making  
     100  # sure that the final expanded path includes the root path.  If it doesn't 
    99101  # than it simply gives a 404. 
    100102  # 
    101103  # If you pass nil as the root path, it will not check any locations or 
    102   # expand any paths. This lets you serve files from multiple directories 
     104  # expand any paths. This lets you serve files from multiple drives 
    103105  # on win32. 
    104106  # 
     
    106108  # can change it anything you want using the DirHandler.default_content_type 
    107109  # attribute. 
     110  # 
    108111  class DirHandler < HttpHandler 
    109112    attr_accessor :default_content_type