From 4614e1fa4ff4cb5d7442f680a053298e0cc80819 Mon Sep 17 00:00:00 2001 From: Antonio Terceiro Date: Sun, 10 May 2015 20:40:19 -0300 Subject: Fix regression in `include-images` option test/tc_httpfetcher.rb can't still be re-enabled because it hits the network, and a hostname that is no longer valid. --- lib/feed2imap/itemtomail.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/feed2imap/itemtomail.rb b/lib/feed2imap/itemtomail.rb index fcf8f8b..455a136 100644 --- a/lib/feed2imap/itemtomail.rb +++ b/lib/feed2imap/itemtomail.rb @@ -99,7 +99,8 @@ def item_to_mail(config, item, id, updated, from = 'Feed2Imap', inline_images = htmlpart.body.gsub!(/(]+)src="(\S+?\/([^\/]+?\.(png|gif|jpe?g)))"([^>]*>)/i) do |match| # $2 contains url, $3 the image name, $4 the image extension begin - image = Base64.encode64(HTTPFetcher::fetch($2, Time.at(0)).chomp) + "\n" + fetcher = HTTPFetcher.new + image = Base64.encode64(fetcher.fetch($2, Time.at(0)).chomp) + "\n" cid = "#{Digest::MD5.hexdigest($2)}@#{config.hostname}" if not cids.include?(cid) cids << cid -- cgit v1.2.3