From eca99c93007e64df3338beaee3d56237a1d77f82 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: http://svn.ruby-lang.org/repos/ruby/trunk@5888 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 6 ++++++ lib/net/http.rb | 6 +++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 3d61414b1..5fd2fccdc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Fri Mar 5 19:42:09 2004 Minero Aoki + + * 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] + Fri Mar 5 00:51:35 2004 Dave Thomas * lib/test/unit.rb: MOve RDoc documentation so that you can diff --git a/lib/net/http.rb b/lib/net/http.rb index 6e0e7e03a..b0334a275 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