From d07590442c49c13257e6927481fd928f235905d9 Mon Sep 17 00:00:00 2001 From: Sam Ford <1584702+samford@users.noreply.github.com> Date: Thu, 26 Nov 2020 10:31:38 -0500 Subject: [PATCH] livecheck: handle URI#parse URI::InvalidURIError --- Library/Homebrew/livecheck/livecheck.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/livecheck/livecheck.rb b/Library/Homebrew/livecheck/livecheck.rb index fad448d0c3..0ce4a1d6e7 100644 --- a/Library/Homebrew/livecheck/livecheck.rb +++ b/Library/Homebrew/livecheck/livecheck.rb @@ -314,7 +314,12 @@ module Homebrew # Preprocesses and returns the URL used by livecheck. # @return [String] def preprocess_url(url) - uri = URI.parse url + begin + uri = URI.parse url + rescue URI::InvalidURIError + return url + end + host = uri.host == "github.s3.amazonaws.com" ? "github.com" : uri.host path = uri.path.delete_prefix("/").delete_suffix(".git") scheme = uri.scheme