about summary refs log tree commit homepage
path: root/test/http.rb
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2014-09-03 17:27:06 +0000
committerEric Wong <e@80x24.org>2014-09-03 17:27:06 +0000
commit6ac46bfadaf61d89149e215ad6dcff76ee1a90ae (patch)
tree8a7524caf2ab0aa1d81170699cad59510d5f151e /test/http.rb
parent4fbe02062007d1ad073a550f5e37b599fc0019e4 (diff)
downloadcmogstored-empty-header-values.tar.gz
Diffstat (limited to 'test/http.rb')
-rw-r--r--test/http.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/http.rb b/test/http.rb
index e23bddf..892e2db 100644
--- a/test/http.rb
+++ b/test/http.rb
@@ -38,6 +38,20 @@ class TestHTTP < Test::Unit::TestCase
     assert status.success?, status.inspect
   end
 
+  # neon does this
+  def test_empty_request_value
+    @client.write("GET / HTTP/1.1\r\n" \
+                  "Keep-Alive: \r\nConnection: TE,Keep-Alive\r\n\r\n")
+    buf = @client.readpartial(12345)
+    assert_match(%r{\AHTTP/1\.1 200 OK}, buf)
+
+    # ensure persistent connections work
+    @client.write("GET / HTTP/1.1\r\n" \
+                  "Missing-Space:\r\n\r\n")
+    buf = @client.readpartial(12345)
+    assert_match(%r{\AHTTP/1\.1 200 OK}, buf)
+  end
+
   def test_slash_for_mogadm_check
     Net::HTTP.start(@host, @port) do |http|
       [ Net::HTTP::Get, Net::HTTP::Head ].each do |meth|