transcoder: handle #length as #size

This commit is contained in:
HoneyryderChuck 2019-03-16 02:40:25 +00:00
parent d24c80b298
commit 9475c76aea

View File

@ -24,6 +24,8 @@ module HTTPX::Transcoder
@raw.map(&:bytesize).reduce(0, :+)
elsif @raw.respond_to?(:size)
@raw.size || Float::INFINITY
elsif @raw.respond_to?(:length)
@raw.length || Float::INFINITY
elsif @raw.respond_to?(:each)
Float::INFINITY
else