Ticket #11 (closed bug: fixed)

Opened 7 months ago

Last modified 7 months ago

DirHandler bug when passing in nil root path

Reported by: evanweaver Assigned to: evanweaver
Priority: minor Milestone: 1.1.4
Component: Mongrel Keywords:
Cc:

Description

Bugs: Browse | Submit New | Admin #17712 DirHandler? bug when passing in nil root path Date: 2008-02-01 23:51 Priority: 3 Submitted By: Phil Misiowiec (alertphil) Assigned To: Evan Weaver (evanweaver) Category: mongrel State: Open Summary: DirHandler? bug when passing in nil root path

Detailed description

In http://mongrel.rubyforge.org/svn/branches/stable_1-1/lib/mongrel/handlers.rb,

note the comment above the DirHandler? class says "If you pass nil as the root path, it will not check any locations or expand any paths" but this is incorrect as it results in a nasty type mismatch:

Read error: #<TypeError?: type mismatch: NilClass? given>

The fix for this is easy:

+++ handlers.rb @@ -137,7 +137,7 @@ - if req_path.index(@path) == 0 and File.exist? req_path

+ if (@path.nil? req_path.index(@path) == 0) and File.exist? req_path

I encountered this issue while tweaking the code to fix an issue with Rails page caching when action_controller.page_cache_directory is set. I'll upload my patch separately in a little bit.

Change History

02/19/08 23:54:52 changed by evanweaver

  • status changed from new to closed.
  • resolution set to fixed.

Fixed in the stable branch in #964.