diff options
author | aamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-03-05 10:42:43 +0000 |
---|---|---|
committer | aamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-03-05 10:42:43 +0000 |
commit | eca99c93007e64df3338beaee3d56237a1d77f82 (patch) | |
tree | a4bf25c1ad58146102acdb8bb3e17a548239ef57 /lib/net | |
parent | 0a887a2cd375a52083aa8aa88204ba89ee5b6b05 (diff) | |
download | ruby-eca99c93007e64df3338beaee3d56237a1d77f82.tar.gz ruby-eca99c93007e64df3338beaee3d56237a1d77f82.tar.xz ruby-eca99c93007e64df3338beaee3d56237a1d77f82.zip |
* 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
Diffstat (limited to 'lib/net')
-rw-r--r-- | lib/net/http.rb | 6 |
1 files changed, 5 insertions, 1 deletions
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 # |