From: Nobuyoshi Nakada Date: 2009-04-14T13:26:24+09:00 Subject: Re: Potential bug in Net::HTTP, and tentative patch Hi, At Tue, 14 Apr 2009 12:33:01 +0900, Yves-Eric Martin wrote in [ruby-talk:333820]: > Other than my quick and dirty patch, is there a way to tell Net::HTTP > to ignore the EOFError and accept non-compliant input? Again, the point > is that an image, which displays fine in Internet Explorer, Firefox and > Safari, cannot be downloaded with Net::HTTP. While I understand the > "not RFC-compliant" argument, for practical reasons, it does seem a bit > limiting... See rdoc of Net::HTTPResponse#read_body and Net::HTTP#request_get. out = "" # or open(destfile, "wb") begin Net::HTTP.get_response(uri) do |res| res.read_body {|s| out << s} end rescue EOFError end -- Nobu Nakada