summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2010-06-14 08:00:04 +0000
committerEric Wong <normalperson@yhbt.net>2010-06-14 08:00:04 +0000
commit075f83bf7929daa152dc1c12e2c53b8c61cc15c0 (patch)
treeec9dec22f0d50708c545acd83d12a03aece8cdbf
parent0cb02efd0e2e2c80667863fd404d1fad7c63bb1f (diff)
Rack 1.2 no longer requires "rack.input" objects respond
to size.
-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 ef2a18e..412c1d9 100644
--- a/lib/unicorn/app/exec_cgi.rb
+++ b/lib/unicorn/app/exec_cgi.rb
@@ -120,7 +120,8 @@ module Unicorn::App
     # ensures rack.input is a file handle that we can redirect stdin to
     def force_file_input(env)
       inp = env['rack.input']
-      if inp.size == 0 # inp could be a StringIO or StringIO-like object
+      # inp could be a StringIO or StringIO-like object
+      if inp.respond_to?(:size) && inp.size == 0
         ::File.open('/dev/null', 'rb')
       else
         tmp = Unicorn::Util.tmpio