Skip to content

unpack: Fallback to untar when tgz isn't compressed

Administrator requested to merge ts/npm-tgz-fallback-to-tar into main

Created by: tsenart

This commit makes unpack.Tgz fallback to unpack.Tar when the input isn't gzip compressed.

Some npm package tarballs, despite ending with the .tgz extension, aren't actually gzip compressed, only tar-ed up.

Example: https://registry.npmjs.org/@types/tmp/-/tmp-0.0.28.tgz

image

From https://sourcegraph.com/github.com/golang/go@baf61e4a67789e20f019507287a324cca06bed42/-/blob/src/compress/gzip/gunzip.go?L185 image

Closes #32052 (closed)

Test plan

Integration test.

Merge request reports

Loading