summaryrefslogtreecommitdiff
path: root/lib/feed2imap/httpfetcher.rb
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--lib/feed2imap/httpfetcher.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/feed2imap/httpfetcher.rb b/lib/feed2imap/httpfetcher.rb
index c7a92c7..1d82b53 100644
--- a/lib/feed2imap/httpfetcher.rb
+++ b/lib/feed2imap/httpfetcher.rb
@@ -29,6 +29,8 @@ require 'uri'
# max number of redirections
MAXREDIR = 5
+HTTPDEBUG = true
+
# Class used to retrieve the feed over HTTP
class HTTPFetcher
def HTTPFetcher::fetcher(baseuri, uri, lastcheck, recursion)
@@ -66,7 +68,10 @@ class HTTPFetcher
return response.body
when Net::HTTPRedirection
# if not modified
- return nil if Net::HTTPNotModified === response
+ if Net::HTTPNotModified === response
+ puts "HTTPNotModified on #{uri}" if HTTPDEBUG
+ return nil
+ end
if recursion > 0
redir = URI::join(uri.to_s, response['location'])
return fetcher(baseuri, redir, lastcheck, recursion - 1)