diff --git a/bazel/browsers/update-script/browser-artifact.ts b/bazel/browsers/update-script/browser-artifact.ts index e424939b95..68f40c934f 100644 --- a/bazel/browsers/update-script/browser-artifact.ts +++ b/bazel/browsers/update-script/browser-artifact.ts @@ -44,8 +44,11 @@ export function detectArtifactExtension(filePath: string) { // Iterate from the end of the path, finding the largest possible // extension substring, accounting for cases like `a/b.tmp/file.tar.gz`. while ((currentPart = path.extname(tmpPath)) !== '') { - // An extension needs to be a continuous set of alphanumeric characters. This is a strict - // requirement, but sufficient for our needs and helps making the determinationmore proof. + // An extension needs to be a continuous set of alphanumeric characters. This is a rather + // strict requirement as technically extensions could contain e.g. `dashes`. In our case + // this strictness is acceptable though as we don't expect such extensions and it makes + // this extension detection logic more correct. e.g. the logic would not incorrectly + // detect an extension for `firefox-97.0-linux.tar.gz` to `0-linux.tar.gz`. if (!/^\.[a-zA-Z0-9]+$/.test(currentPart)) { break; }