diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-10-28 04:53:57 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-10-28 04:53:57 +0000 |
commit | a671a06d2574ef888018081ed29bb80851a086f7 (patch) | |
tree | 44c0350ca9a2ef464255bb71367c2fcf2bf28f2e /lib/webrick/httprequest.rb | |
parent | 492d120877e6687fa27d68c3bb17f776d14340fc (diff) |
* 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
Diffstat (limited to 'lib/webrick/httprequest.rb')
-rw-r--r-- | lib/webrick/httprequest.rb | 6 |
1 files changed, 4 insertions, 2 deletions
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 |