aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--lib/webrick/httprequest.rb6
2 files changed, 10 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index db055d6f38..01fb512482 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Thu Oct 28 12:06:54 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * 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@atdot.net>
* gc.c (GC.stat): added. [ruby-dev:38607]
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