diff --git a/lib/net/http/response.rb b/lib/net/http/response.rb index 66132985d9..9e6e98f86d 100644 --- a/lib/net/http/response.rb +++ b/lib/net/http/response.rb @@ -104,6 +104,11 @@ def initialize(httpv, code, msg) #:nodoc: internal use only # Accept-Encoding header from the user. attr_accessor :decode_content + # The underlying IO socket used when streaming response bodies. Note + # that reading from the socket directly will mean the response will + # *not* contain a (meaningful) body. + attr_reader :socket + def inspect "#<#{self.class} #{@code} #{@message} readbody=#{@read}>" end