[Mongrel] is there a FileHandler class out there?

cdr _ at whats-your.name
Mon Feb 4 04:20:58 EST 2008

after finding this solution to Paul Graham's 'said' problem (http://arclanguage.org/item?id=722):

case r.qs
when '': isindex
when /^@/: r.qs.tail
else a'follow',:href =>'?@'+r.qs

i noticed it was broken if you use a space!

theres this line in DirHandler#can_serve:
  req_path = HttpRequest.unescape(path_info)

which was modifying the path i sent in..

req.params["PATH_INFO"] = '/some/file/path'

which when you think about it. modifying the requests param hash afterwards? about as kosher as an Al Pastor burrito

its just that so far its the easiest way to take advantage of the good bits in the dirhandler that check a file against ETAGs and If-modified and conditionally serve.

which is seperate logically from the 'unescape incoming request' and 'generate dirlisting' stuff, but all in one big ball of mud at the moment..

Zed told me on Fri, 1 Dec 2006 13:12:02 -0500

"DirHandler, being a DIR handler and not a FILE handler"

and he's still right.. 

if there isnt one, its easier to just steal the 10 or so lines from dirhandler im needing and throw them into an ebb handler, since that way i dont have to worry about breaking other peoples apps by submitting a patch.. and simultaneously bypass all sorts of other code im not using in the process.

 so does a FileHandler already exist?

More information about the Mongrel-users mailing list