Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
--- a\ruby\lib\ruby\1.8\webrick\httprequest.rb Tue Feb 13 03:01:20 2007
+++ b\ruby\lib\ruby\1.8\webrick\httprequest.rb Thu May 7 16:45:54 2009
@@ -16,6 +16,11 @@
require 'webrick/httputils'
require 'webrick/cookie'
+# IronRuby bug: IO#read seems to chop off the first char
+
+class TCPSocket
+ def read size
+ recv size
+ end
+end
+
module WEBrick
class HTTPRequest
@@ -161,8 +166,8 @@
end
def to_s
- ret = @request_line.dup
- @raw_header.each{|line| ret << line }
+ ret = @request_line ? @request_line.dup : ""
+ @raw_header.each{|line| ret << line } if @raw_header
ret << CRLF
ret << body if body
ret
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.