From 75f1dc7836c778d47b0690f4d582dac990b22b29 Mon Sep 17 00:00:00 2001 From: Matthew Wise Date: Fri, 19 Jul 2024 09:39:00 -0500 Subject: [PATCH] fix use of uri open --- app/jobs/update_feed_job.rb | 2 +- lib/feedbag.rb | 2 +- lib/haven_feed_entry.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/jobs/update_feed_job.rb b/app/jobs/update_feed_job.rb index 6683dfd..964c90c 100644 --- a/app/jobs/update_feed_job.rb +++ b/app/jobs/update_feed_job.rb @@ -116,7 +116,7 @@ def update_feed(feed, earliest_time, latest_time) def fetch_feed_title(feed_url) cleanurl, auth_opts = HavenFeedEntry.parse_auth(feed_url) - URI.open(cleanurl, auth_opts) do |rss| + URI(cleanurl).open(auth_opts) do |rss| feed = RSS::Parser.parse(rss, validate: false) if (feed.feed_type == "rss") return feed.channel.title diff --git a/lib/feedbag.rb b/lib/feedbag.rb index d287628..1386934 100644 --- a/lib/feedbag.rb +++ b/lib/feedbag.rb @@ -93,7 +93,7 @@ def find(url, args = {}) end begin - html = URI.open(url) do |f| + html = URI(url).open do |f| content_type = f.content_type.downcase if content_type == "application/octet-stream" # open failed content_type = f.meta["content-type"].gsub(/;.*$/, '') diff --git a/lib/haven_feed_entry.rb b/lib/haven_feed_entry.rb index 8fd59be..ea948c3 100644 --- a/lib/haven_feed_entry.rb +++ b/lib/haven_feed_entry.rb @@ -49,7 +49,7 @@ def initialize(feed, item) def self.fetch_feed_content(feed_url) entries = nil cleanurl, auth_opts = parse_auth(feed_url) - URI.open(cleanurl, auth_opts) do |rss| + URI(cleanurl).open(auth_opts) do |rss| entries = parse_feed_content(rss) end entries