summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-11-18 16:48:32 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-11-18 16:48:32 +0000
commit5970c16488cc2505f636985dc43188947cd7c4cc (patch)
treecd11a4cebfc233b5d4668b37c135aa06ccff1fc2
parent0929f33fed68f515cc35d35355917baa1999c390 (diff)
downloadruby-5970c16488cc2505f636985dc43188947cd7c4cc.tar.gz
ruby-5970c16488cc2505f636985dc43188947cd7c4cc.tar.xz
ruby-5970c16488cc2505f636985dc43188947cd7c4cc.zip
merges r20244 from trunk into ruby_1_9_1.
* lib/webrick/httprequest.rb (WEBrick::HTTPRequest#read_request_line): use possessive match for path retrieval to avoid huge recursion for insanely long path. git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@20271 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog6
-rw-r--r--lib/webrick/httprequest.rb2
2 files changed, 7 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index fc7da7ced..ac6ba2b01 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Tue Nov 18 15:56:55 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * lib/webrick/httprequest.rb (WEBrick::HTTPRequest#read_request_line):
+ use possessive match for path retrieval to avoid huge recursion
+ for insanely long path.
+
Tue Nov 18 15:50:11 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
* re.c (rb_reg_desc): re might be NULL.
diff --git a/lib/webrick/httprequest.rb b/lib/webrick/httprequest.rb
index 889a83abe..3a8d74401 100644
--- a/lib/webrick/httprequest.rb
+++ b/lib/webrick/httprequest.rb
@@ -249,7 +249,7 @@ module WEBrick
end
@request_time = Time.now
raise HTTPStatus::EOFError unless @request_line
- if /^(\S+)\s+(\S+)(?:\s+HTTP\/(\d+\.\d+))?\r?\n/mo =~ @request_line
+ if /^(\S+)\s+(\S++)(?:\s+HTTP\/(\d+\.\d+))?\r?\n/mo =~ @request_line
@request_method = $1
@unparsed_uri = $2
@http_version = HTTPVersion.new($3 ? $3 : "0.9")