about summary refs log tree commit homepage
path: root/lib
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2010-11-18 07:36:27 +0800
committerEric Wong <normalperson@yhbt.net>2010-11-18 07:36:27 +0800
commit3362dc51934c15fd944748e55ba4a470cc60d27d (patch)
tree483f0ed5401889855d104fd62cc19784e0397eb4 /lib
parent390e351dd1283d4c80a12b744b1327fff091a141 (diff)
downloadunicorn-3362dc51934c15fd944748e55ba4a470cc60d27d.tar.gz
Any calls to read with an explicit zero length now returns an
empty string.  While not explicitly specified by Rack::Lint,
this is for compatibility with StringIO and IO methods which
are common in other web servers.
Diffstat (limited to 'lib')
-rw-r--r--lib/unicorn/stream_input.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/unicorn/stream_input.rb b/lib/unicorn/stream_input.rb
index 2c8e40a..ef8997e 100644
--- a/lib/unicorn/stream_input.rb
+++ b/lib/unicorn/stream_input.rb
@@ -60,7 +60,7 @@ class Unicorn::StreamInput
           @rbuf.replace('')
         end
       end
-      rv = nil if rv.empty?
+      rv = nil if rv.empty? && length != 0
     end
     rv
   end