From 87275504ab0690e243401db6985f6253ccc17b65 Mon Sep 17 00:00:00 2001 From: aamine Date: Fri, 5 Mar 2004 10:42:43 +0000 Subject: * lib/net/http.rb (HTTPResponse#to_ary): should return an object which does not respond to #to_ary. It causes infinite loop in puts. [ruby-core:02578] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5888 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/net/http.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib/net/http.rb') diff --git a/lib/net/http.rb b/lib/net/http.rb index 6e0e7e03ab..b0334a2757 100644 --- a/lib/net/http.rb +++ b/lib/net/http.rb @@ -1607,7 +1607,11 @@ module Net # :nodoc: # def to_ary warn "net/http.rb: warning: Net::HTTP v1.1 style assignment found at #{caller(1)[0]}; use `response = http.get(...)' instead." if $VERBOSE - [self, body()] + res = self.dup + class << res + undef to_ary + end + [res, res.body] end # -- cgit v1.2.3