lib/atom/feed.rb in atom-tools-0.9.2 vs lib/atom/feed.rb in atom-tools-0.9.3

- old
+ new

@@ -165,24 +165,24 @@ headers["If-None-Match"] = @etag if @etag headers["If-Modified-Since"] = @last_modified if @last_modified res = @http.get(@uri, headers) - # we'll be forgiving about feed content types. - res.validate_content_type(["application/atom+xml", - "application/xml", - "text/xml"]) - if res.code == "304" # we're already all up to date return self elsif res.code == "410" raise Atom::FeedGone, "410 Gone (#{@uri})" elsif res.code != "200" raise Atom::HTTPException, "Unexpected HTTP response code: #{res.code}" end - @etag = res["Etag"] if res["Etag"] + # we'll be forgiving about feed content types. + res.validate_content_type(["application/atom+xml", + "application/xml", + "text/xml"]) + + @etag = res["ETag"] if res["ETag"] @last_modified = res["Last-Modified"] if res["Last-Modified"] xml = res.body coll = REXML::Document.new(xml)