From 8940d198fef2cbf0cfbf8a274868def52e15b1ce Mon Sep 17 00:00:00 2001 From: Sam Ford <1584702+samford@users.noreply.github.com> Date: Tue, 17 Aug 2021 19:15:07 -0400 Subject: [PATCH] Make tarball extension regex explicit --- Library/Homebrew/livecheck/strategy.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/livecheck/strategy.rb b/Library/Homebrew/livecheck/strategy.rb index 056af4ee00..c65a00e68d 100644 --- a/Library/Homebrew/livecheck/strategy.rb +++ b/Library/Homebrew/livecheck/strategy.rb @@ -76,7 +76,12 @@ module Homebrew HTTP_HEAD_BODY_SEPARATOR = "\r\n\r\n" # A regex used to identify a tarball extension at the end of a string. - TARBALL_EXTENSION_REGEX = /\.t(?:ar\..+|[a-z0-9]+)$/i.freeze + TARBALL_EXTENSION_REGEX = / + \.t + (?:ar(?:\.(?:bz2|gz|lz|lzma|lzo|xz|Z|zst))?| + b2|bz2?|z2|az|gz|lz|lzma|xz|Z|aZ|zst) + $ + /ix.freeze # An error message to use when a `strategy` block returns a value of # an inappropriate type.