about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2009-08-18 15:27:09 -0700
committerEric Wong <normalperson@yhbt.net>2009-08-18 15:27:09 -0700
commit55299ddfc9ca6ebb59883e425c73c4eaedd86aaa (patch)
treec1e0dd483c3b87e1a01e1036eea2c3c4071818ae
parentfd763aa5633724de9e5c580f27ea61850a58d9b8 (diff)
downloadunicorn-55299ddfc9ca6ebb59883e425c73c4eaedd86aaa.tar.gz
Otherwise we're promoting broken practices
-rw-r--r--lib/unicorn/rainbows.rb14
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/unicorn/rainbows.rb b/lib/unicorn/rainbows.rb
index 6c9a0d6..862de9d 100644
--- a/lib/unicorn/rainbows.rb
+++ b/lib/unicorn/rainbows.rb
@@ -116,11 +116,7 @@ end
 if $0 == __FILE__
   app = lambda { |env|
     if /\A100-continue\z/i =~ env['HTTP_EXPECT']
-      header = {
-        'Content-Type' => 'application/octet-stream',
-        'Content-Length' => '0'
-      }
-      return [ 100, header, [] ]
+      return [ 100, {}, [] ]
     end
     digest = Digest::SHA1.new
     input = env['rack.input']
@@ -128,7 +124,13 @@ if $0 == __FILE__
     while buf = input.read(16384, buf)
       digest.update(buf)
     end
-    [ 200, { 'X-SHA1' => digest.hexdigest }, [ env.inspect << "\n" ] ]
+    body = env.inspect << "\n"
+    header = {
+      'X-SHA1' => digest.hexdigest,
+      'Content-Length' => body.size.to_s,
+      'Content-Type' => 'text/plain',
+    }
+    [ 200, header, [ body ] ]
   }
   options = {
     :listeners => %w(0.0.0.0:8080),