about summary refs log tree commit homepage
path: root/test
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2009-09-03 10:55:11 -0700
committerEric Wong <normalperson@yhbt.net>2009-09-03 10:55:11 -0700
commitd4fd801ceebf56fe9204a3b2829138fb4c433d39 (patch)
tree435290909d2a5c9021fb25d4db27aff0cbeb96f4 /test
parent52c2c6273e7c007543de776937a25827c27d0ff1 (diff)
downloadunicorn-d4fd801ceebf56fe9204a3b2829138fb4c433d39.tar.gz
HTTP/0.9 GET requests expect responses without headers.  Some
weird applications/tools still use the ancient HTTP/0.9
protocol for weird reasons, so we'll support them.

ref: rfc 1945, section 4.1
Diffstat (limited to 'test')
-rw-r--r--test/unit/test_server.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/unit/test_server.rb b/test/unit/test_server.rb
index 0b409ba..fff7f89 100644
--- a/test/unit/test_server.rb
+++ b/test/unit/test_server.rb
@@ -148,6 +148,16 @@ class WebServerTest < Test::Unit::TestCase
     assert_nothing_raised { sock.close }
   end
 
+  def test_http_0_9
+    sock = nil
+    assert_nothing_raised do
+      sock = TCPSocket.new('127.0.0.1', @port)
+      sock.syswrite("GET /hello\r\n")
+    end
+    assert_match 'hello!\n', sock.sysread(4096)
+    assert_nothing_raised { sock.close }
+  end
+
   def test_header_is_too_long
     redirect_test_io do
       long = "GET /test HTTP/1.1\r\n" + ("X-Big: stuff\r\n" * 15000) + "\r\n"