[前][次][番号順一覧][スレッド一覧]

ruby-changes:32840

From: nobu <ko1@a...>
Date: Wed, 12 Feb 2014 18:01:34 +0900 (JST)
Subject: [ruby-changes:32840] nobu:r44919 (trunk): httpservlet/filehandler.rb: pass queries

nobu	2014-02-12 18:01:30 +0900 (Wed, 12 Feb 2014)

  New Revision: 44919

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=44919

  Log:
    httpservlet/filehandler.rb: pass queries
    
    * lib/webrick/httpservlet/filehandler.rb (set_dir_list): pass the
      given queries to subdirectories.

  Modified files:
    trunk/lib/webrick/httpservlet/filehandler.rb
Index: lib/webrick/httpservlet/filehandler.rb
===================================================================
--- lib/webrick/httpservlet/filehandler.rb	(revision 44918)
+++ lib/webrick/httpservlet/filehandler.rb	(revision 44919)
@@ -487,6 +487,7 @@ module WEBrick https://github.com/ruby/ruby/blob/trunk/lib/webrick/httpservlet/filehandler.rb#L487
         res.body << "</TR></THEAD>\n"
         res.body << "<TBODY>\n"
 
+        query.sub!(/\A&/, '?')
         list.unshift [ "..", File::mtime(local_path+"/.."), -1 ]
         list.each{ |name, time, size|
           if name == ".."
@@ -496,7 +497,7 @@ module WEBrick https://github.com/ruby/ruby/blob/trunk/lib/webrick/httpservlet/filehandler.rb#L497
           else
             dname = name
           end
-          s =  "<TR><TD class=\"name\"><A HREF=\"#{HTTPUtils::escape(name)}\">#{HTMLUtils::escape(dname)}</A></TD>"
+          s =  "<TR><TD class=\"name\"><A HREF=\"#{HTTPUtils::escape(name)}#{query if name.end_with?('/')}\">#{HTMLUtils::escape(dname)}</A></TD>"
           s << "<TD class=\"mtime\">" << (time ? time.strftime("%Y/%m/%d %H:%M") : "") << "</TD>"
           s << "<TD class=\"size\">" << (size >= 0 ? size.to_s : "-") << "</TD></TR>\n"
           res.body << s

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]