Make tarball extension regex explicit

This commit is contained in:
Sam Ford 2021-08-17 19:15:07 -04:00
parent 26821301e7
commit 8940d198fe
No known key found for this signature in database
GPG Key ID: 95209E46C7FFDEFE

View File

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