diff options
author | Antonio Terceiro <terceiro@softwarelivre.org> | 2015-05-10 20:40:19 -0300 |
---|---|---|
committer | Antonio Terceiro <terceiro@softwarelivre.org> | 2015-05-10 20:41:41 -0300 |
commit | 4614e1fa4ff4cb5d7442f680a053298e0cc80819 (patch) | |
tree | ee38185edcad6f4aa89ab88a6dd863e81ab4f70c /lib/feed2imap/itemtomail.rb | |
parent | e6744a2aac310bff2680207845d121a42f04209b (diff) | |
download | feed2imap-4614e1fa4ff4cb5d7442f680a053298e0cc80819.tar.gz feed2imap-4614e1fa4ff4cb5d7442f680a053298e0cc80819.tar.bz2 feed2imap-4614e1fa4ff4cb5d7442f680a053298e0cc80819.zip |
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.
Diffstat (limited to 'lib/feed2imap/itemtomail.rb')
-rw-r--r-- | lib/feed2imap/itemtomail.rb | 3 |
1 files changed, 2 insertions, 1 deletions
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!(/(<img[^>]+)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 |