mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Fix rubocop issues (#14715)
This commit is contained in:
@@ -117,8 +117,8 @@ class TopicEmbed < ActiveRecord::Base
|
||||
follow_canonical: true,
|
||||
)
|
||||
|
||||
url = fd.resolve
|
||||
return if url.blank?
|
||||
uri = fd.resolve
|
||||
return if uri.blank?
|
||||
|
||||
opts = {
|
||||
tags: %w[div p code pre h1 h2 h3 b em i strong a img ul li ol blockquote],
|
||||
@@ -132,7 +132,7 @@ class TopicEmbed < ActiveRecord::Base
|
||||
|
||||
response = FetchResponse.new
|
||||
begin
|
||||
html = open(url, allow_redirections: :safe).read
|
||||
html = uri.read(allow_redirections: :safe)
|
||||
rescue OpenURI::HTTPError, Net::OpenTimeout
|
||||
return
|
||||
end
|
||||
@@ -256,10 +256,6 @@ class TopicEmbed < ActiveRecord::Base
|
||||
body
|
||||
end
|
||||
end
|
||||
|
||||
def self.open(uri, **kwargs)
|
||||
URI.open(uri, **kwargs)
|
||||
end
|
||||
end
|
||||
|
||||
# == Schema Information
|
||||
|
||||
Reference in New Issue
Block a user