From a671a06d2574ef888018081ed29bb80851a086f7 Mon Sep 17 00:00:00 2001 From: naruse Date: Thu, 28 Oct 2010 04:53:57 +0000 Subject: * lib/webrick/httprequest.rb (read_request_line): extend max length to 2083. This is from Internet Explorer's max uri length. http://support.microsoft.com/kb/208427 [ruby-core:32924] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29617 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/webrick/httprequest.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/webrick/httprequest.rb b/lib/webrick/httprequest.rb index 75d26b529a..d179995d77 100644 --- a/lib/webrick/httprequest.rb +++ b/lib/webrick/httprequest.rb @@ -251,9 +251,11 @@ module WEBrick private + MAX_URI_LENGTH = 2083 # :nodoc: + def read_request_line(socket) - @request_line = read_line(socket, 1024) if socket - if @request_line.bytesize >= 1024 and @request_line[-1, 1] != LF + @request_line = read_line(socket, MAX_URI_LENGTH) if socket + if @request_line.bytesize >= MAX_URI_LENGTH and @request_line[-1, 1] != LF raise HTTPStatus::RequestURITooLarge end @request_time = Time.now -- cgit v1.2.3