lib/async/http/body/stream.rb in async-http-0.46.3 vs lib/async/http/body/stream.rb in async-http-0.46.4
- old
+ new
@@ -27,9 +27,11 @@
class Stream
def initialize(input, output = Writable.new)
@input = input
@output = output
+ raise ArgumentError, "Non-writable output!" unless output.respond_to?(:write)
+
# Will hold remaining data in `#read`.
@buffer = nil
@closed = false
end