Skip to content

Instantly share code, notes, and snippets.

@jschementi
Created May 14, 2009 23:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jschementi/111988 to your computer and use it in GitHub Desktop.
Save jschementi/111988 to your computer and use it in GitHub Desktop.
--- 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