lib/protocol/http/body/stream.rb in protocol-http-0.36.0 vs lib/protocol/http/body/stream.rb in protocol-http-0.37.0
- old
+ new
@@ -2,11 +2,11 @@
# Released under the MIT License.
# Copyright, 2019-2024, by Samuel Williams.
# Copyright, 2023, by Genki Takiuchi.
-require_relative 'buffered'
+require_relative "buffered"
module Protocol
module HTTP
module Body
# The input stream is an IO-like object which contains the raw HTTP POST data. When applicable, its external encoding must be “ASCII-8BIT” and it must be opened in binary mode, for Ruby 1.9 compatibility. The input stream must respond to gets, each, read and rewind.
@@ -41,10 +41,10 @@
#
# @param length [Integer] the amount of data to read
# @param buffer [String] the buffer which will receive the data
# @return a buffer containing the data
def read(length = nil, buffer = nil)
- return '' if length == 0
+ return "" if length == 0
buffer ||= String.new.force_encoding(Encoding::BINARY)
# Take any previously buffered data and replace it into the given buffer.
if @buffer