about summary refs log tree commit homepage
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/test_proxy_pass.rb22
1 files changed, 16 insertions, 6 deletions
diff --git a/test/test_proxy_pass.rb b/test/test_proxy_pass.rb
index 943fb35..c1539f8 100644
--- a/test/test_proxy_pass.rb
+++ b/test/test_proxy_pass.rb
@@ -86,13 +86,23 @@ class TestProxyPass < Testcase
           delay = $1.to_f
           chunky = Object.new
           chunky.instance_variable_set(:@delay, delay)
-          def chunky.each
-            sleep @delay
-            yield "3\r\nHI!\r\n"
-            sleep @delay
-            yield "0\r\n\r\n"
+          if env['HTTP_VERSION'] == 'HTTP/1.0'
+            h = [ %w(Content-Type text/pain), %w(Content-Length 3) ]
+            def chunky.each
+              %w(H I !).each do |x|
+                sleep @delay
+                yield x
+              end
+            end
+          else
+            h = [ %w(Content-Type text/pain), %w(Transfer-Encoding chunked) ]
+            def chunky.each
+              sleep @delay
+              yield "3\r\nHI!\r\n"
+              sleep @delay
+              yield "0\r\n\r\n"
+            end
           end
-          h = [ %w(Content-Type text/pain), %w(Transfer-Encoding chunked) ]
           [ 200, h, chunky ]
         else
           [ 200, h, [ "hi\n"] ]