jschementi (owner)

Revisions

gist: 111988 Download_button fork
public
Public Clone URL: git://gist.github.com/111988.git
Embed All Files: show embed
webrick-1.8.6.patch #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
--- 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