rubocop: fix Security/Open

This commit is contained in:
Jonathan Chang 2020-11-09 20:11:45 +11:00
parent ab7b757400
commit 556c81b540
2 changed files with 2 additions and 2 deletions

View File

@ -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

View File

@ -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|