summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-10-28 04:53:57 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-10-28 04:53:57 +0000
commita671a06d2574ef888018081ed29bb80851a086f7 (patch)
tree44c0350ca9a2ef464255bb71367c2fcf2bf28f2e /lib
parent492d120877e6687fa27d68c3bb17f776d14340fc (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')
-rw-r--r--lib/webrick/httprequest.rb6
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