lib/httpx/request/body.rb in httpx-1.1.5 vs lib/httpx/request/body.rb in httpx-1.2.0
- old
+ new
@@ -68,12 +68,12 @@
@body.bytesize
end
# sets the body to yield using chunked trannsfer encoding format.
def stream(body)
- encoded = body
- encoded = Transcoder::Chunker.encode(body.enum_for(:each)) if chunked?
- encoded
+ return body unless chunked?
+
+ Transcoder::Chunker.encode(body.enum_for(:each))
end
# returns whether the body yields infinitely.
def unbounded_body?
return @unbounded_body if defined?(@unbounded_body)