rubocop: fix Security/Open
This commit is contained in:
parent
ab7b757400
commit
556c81b540
@ -47,7 +47,7 @@ module Homebrew
|
||||
# content
|
||||
# @return [Array]
|
||||
def self.page_matches(url, regex)
|
||||
page = URI.open(url).read
|
||||
page = URI.parse(url).open.read
|
||||
matches = page.scan(regex)
|
||||
matches.map(&:first).uniq
|
||||
end
|
||||
|
||||
@ -87,7 +87,7 @@ module Homebrew
|
||||
match_data = { matches: {}, regex: regex, url: page_url }
|
||||
|
||||
# Cache responses to avoid unnecessary duplicate fetches
|
||||
@page_data[page_url] = URI.open(page_url).read unless @page_data.key?(page_url)
|
||||
@page_data[page_url] = URI.parse(page_url).open.read unless @page_data.key?(page_url)
|
||||
|
||||
matches = @page_data[page_url].scan(regex)
|
||||
matches.map(&:first).uniq.each do |match|
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user