about summary refs log tree commit homepage
path: root/lib/unicorn/app/exec_cgi.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/unicorn/app/exec_cgi.rb')
-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