Skip to content

Commit

Permalink
fix use of uri open
Browse files Browse the repository at this point in the history
  • Loading branch information
mawise committed Jul 20, 2024
1 parent e6af4d9 commit 75f1dc7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/jobs/update_feed_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/feedbag.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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(/;.*$/, '')
Expand Down
2 changes: 1 addition & 1 deletion lib/haven_feed_entry.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 75f1dc7

Please sign in to comment.