fiddled around a bit and got DirGHandler to work for both files and directories
with spaces in them, and plusses in them (on disk).
eg:
<a
href="/files/usr/portage/packages/All/gtk%2B-2.10.1.tbz2">gtk+-2.10.1.tbz2</a><br/>
<a href="/files/root/hey+whatsthis+dir">hey whatsthis dir</a>
both end up at the right place now..
..c.
--- /a/usr/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3/lib/mongrel/handlers.rb
2006-08-07 12:26:22.000000000 -0400
+++ ./handlers.rb 2006-08-07 13:36:14.000000000 -0400
@@ -173,14 +173,10 @@
head[Const::CONTENT_TYPE] = "text/html"
out << "<html><head><title>Directory Listing</title></head><body>"
Dir.entries(dir).each do |child|
- child = HttpRequest.unescape(child)
next if child == "."
-
- if child == ".."
- out << "<a href=\"#{base}/#{child}\">Up to parent..</a><br/>"
- else
- out << "<a href=\"#{base}/#{child}/\">#{child}</a><br/>"
- end
+ out << "<a href=\"#{base}/#{ HttpRequest.escape(child)}\">"
+ out << (child == ".." ? "Up to parent.." : child)
+ out << "</a><br/>"
end
out << "</body></html>"
end
_______________________________________________
Mongrel-users mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/mongrel-users