diff options
author | Eric Wong <normalperson@yhbt.net> | 2010-06-14 08:00:04 +0000 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2010-06-14 08:00:04 +0000 |
commit | 075f83bf7929daa152dc1c12e2c53b8c61cc15c0 (patch) | |
tree | ec9dec22f0d50708c545acd83d12a03aece8cdbf /lib | |
parent | 0cb02efd0e2e2c80667863fd404d1fad7c63bb1f (diff) | |
download | unicorn-075f83bf7929daa152dc1c12e2c53b8c61cc15c0.tar.gz |
Rack 1.2 no longer requires "rack.input" objects respond to size.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/unicorn/app/exec_cgi.rb | 3 |
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 |