Fix URI parser warning
This commit is contained in:
parent
70bb266d91
commit
34bc30d639
@ -181,7 +181,7 @@ module Cask
|
||||
|
||||
# Cache compiled regex
|
||||
@uri_regex ||= begin
|
||||
uri_regex = ::URI::DEFAULT_PARSER.make_regexp
|
||||
uri_regex = ::URI::RFC2396_PARSER.make_regexp
|
||||
Regexp.new("\\A#{uri_regex.source}\\Z", uri_regex.options)
|
||||
end
|
||||
|
||||
|
||||
@ -366,7 +366,7 @@ class AbstractFileDownloadStrategy < AbstractDownloadStrategy
|
||||
def parse_basename(url, search_query: true)
|
||||
components = { path: T.let([], T::Array[String]), query: T.let([], T::Array[String]) }
|
||||
|
||||
if url.match?(URI::DEFAULT_PARSER.make_regexp)
|
||||
if url.match?(URI::RFC2396_PARSER.make_regexp)
|
||||
uri = URI(url)
|
||||
|
||||
if (uri_query = uri.query.presence)
|
||||
@ -382,7 +382,7 @@ class AbstractFileDownloadStrategy < AbstractDownloadStrategy
|
||||
|
||||
if (uri_path = uri.path.presence)
|
||||
components[:path] = uri_path.split("/").filter_map do |part|
|
||||
URI::DEFAULT_PARSER.unescape(part).presence
|
||||
URI::RFC2396_PARSER.unescape(part).presence
|
||||
end
|
||||
end
|
||||
else
|
||||
|
||||
@ -661,7 +661,7 @@ module Formulary
|
||||
|
||||
# Cache compiled regex
|
||||
@uri_regex ||= begin
|
||||
uri_regex = ::URI::DEFAULT_PARSER.make_regexp
|
||||
uri_regex = ::URI::RFC2396_PARSER.make_regexp
|
||||
Regexp.new("\\A#{uri_regex.source}\\Z", uri_regex.options)
|
||||
end
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user