From 02c8eb1ba809ffe9f41228e5152199a9bc607556 Mon Sep 17 00:00:00 2001 From: gotoyuzo Date: Fri, 30 Jun 2006 10:46:40 +0000 Subject: * lib/webrick/httputils.rb (WEBrick::HTTPUtils._escape): should use String#ord to get ascii code from the one-character string. [ruby-dev:28901] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10434 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/webrick/httputils.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/webrick/httputils.rb') diff --git a/lib/webrick/httputils.rb b/lib/webrick/httputils.rb index e660f04405..c93146997f 100644 --- a/lib/webrick/httputils.rb +++ b/lib/webrick/httputils.rb @@ -358,7 +358,7 @@ module WEBrick def _make_regex(str) /([#{Regexp.escape(str)}])/n end def _make_regex!(str) /([^#{Regexp.escape(str)}])/n end - def _escape(str, regex) str.gsub(regex){ "%%%02X" % $1[0] } end + def _escape(str, regex) str.gsub(regex){ "%%%02X" % $1.ord } end def _unescape(str, regex) str.gsub(regex){ $1.hex.chr } end UNESCAPED = _make_regex(control+space+delims+unwise+nonascii) -- cgit v1.2.3