summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2011-01-21 04:01:01 +0000
committerEric Wong <normalperson@yhbt.net>2011-01-21 11:41:54 -0800
commitd385bc4f3ed7b783b7414f5d34299bd2bf242fe6 (patch)
tree0ab3aa097e377c921b9c3bcad6ab4d4dc526a691
parent3587edb6e88ebe5c24cdde090ba8dd98de493d63 (diff)
We no longer blindly return 200 if the CGI returned another error
code.  We also don't want two Status headers in our output since we
no longer filter it out.
(cherry picked from commit 6cca8e61c66c1c2a8ebe260813fa83e44530a768)
-rw-r--r--lib/unicorn/app/exec_cgi.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/unicorn/app/exec_cgi.rb b/lib/unicorn/app/exec_cgi.rb
index 412c1d9..ff5f53a 100644
--- a/lib/unicorn/app/exec_cgi.rb
+++ b/lib/unicorn/app/exec_cgi.rb
@@ -113,8 +113,9 @@ module Unicorn::App
         when /^[ \t]/ then headers[prev] << "\n#{line}" if prev
         end
       end
+      status = headers.delete("Status") || 200
       headers['Content-Length'] = size.to_s
-      [ 200, headers, out ]
+      [ status, headers, out ]
     end
 
     # ensures rack.input is a file handle that we can redirect stdin to