From db49f5350fbb327579d70b4e1f4ac2559c8ec216 Mon Sep 17 00:00:00 2001 From: gotoyuzo Date: Wed, 11 May 2005 07:22:19 +0000 Subject: * lib/webrick/cgi.rb: new methods WEBrick::CGI#[], WEBrick::CGI#logger and WEBrick::CGI#config. (backported from HEAD) * lib/webrick/httputils.rb (WEBrick::HTTPUtils.escape_path): should not use String#split("/"). (backported from HEAD) git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@8424 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/webrick/httputils.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'lib/webrick/httputils.rb') diff --git a/lib/webrick/httputils.rb b/lib/webrick/httputils.rb index e0855222f..67bc281c5 100644 --- a/lib/webrick/httputils.rb +++ b/lib/webrick/httputils.rb @@ -384,9 +384,11 @@ module WEBrick end def escape_path(str) - str.split("/").collect{|i| - _escape(i, UNESCAPED_PCHAR) - }.join("/") + result = "" + str.scan(%r{/([^/]*)}).each{|i| + result << "/" << _escape(i[0], UNESCAPED_PCHAR) + } + return result end def escape8bit(str) -- cgit