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
Download in other formats:
|