summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2010-11-16 13:51:24 -0800
committerEric Wong <normalperson@yhbt.net>2010-11-16 15:53:27 -0800
commit431de671a29b312bd19e615bd4bd99228b0c8b13 (patch)
tree94da785421c81b1ef2aebccf4549bf5c76b8bec6
parent17a734a9f6ccea8c969a574f09b5d8dd3d568a9c (diff)
We may get "rack.input" objects that are not rewindable
in the future, so be prepared for those and do no harm.
-rw-r--r--lib/unicorn/preread_input.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/unicorn/preread_input.rb b/lib/unicorn/preread_input.rb
index ec83cb2..7a315b7 100644
--- a/lib/unicorn/preread_input.rb
+++ b/lib/unicorn/preread_input.rb
@@ -20,7 +20,7 @@ class PrereadInput
   def call(env)
     buf = ""
     input = env["rack.input"]
-    if buf = input.read(16384)
+    if input.respond_to?(:rewind)
       true while input.read(16384, buf)
       input.rewind
     end