ruby-changes:17611
From: naruse <ko1@a...>
Date: Thu, 28 Oct 2010 13:54:08 +0900 (JST)
Subject: [ruby-changes:17611] Ruby:r29617 (trunk): * lib/webrick/httprequest.rb (read_request_line): extend max
naruse 2010-10-28 13:53:57 +0900 (Thu, 28 Oct 2010) New Revision: 29617 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=29617 Log: * 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] Modified files: trunk/ChangeLog trunk/lib/webrick/httprequest.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 29616) +++ ChangeLog (revision 29617) @@ -1,3 +1,9 @@ +Thu Oct 28 12:06:54 2010 NARUSE, Yui <naruse@r...> + + * 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] + Thu Oct 28 04:00:08 2010 Koichi Sasada <ko1@a...> * gc.c (GC.stat): added. [ruby-dev:38607] Index: lib/webrick/httprequest.rb =================================================================== --- lib/webrick/httprequest.rb (revision 29616) +++ lib/webrick/httprequest.rb (revision 29617) @@ -251,9 +251,11 @@ 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 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/