Commit 7f6e473
committed
fix(tools.func): handle GitHub 300 Multiple Choices in tarball mode
When a GitHub repository has both a branch and a tag with the same name
(e.g. Pangolin's '1.12.3'), the API's tarball_url and zipball_url return
HTTP 300 Multiple Choices instead of a redirect. curl saves the JSON
response body as the file, causing 'gzip: stdin: not in gzip format'
when tar tries to extract.
This fix uses the explicit refs/tags/ URL format instead:
https://github.com/$repo/archive/refs/tags/$tag.tar.gz
This URL always returns a proper 302 redirect to the tarball, avoiding
the ambiguity between branch and tag names.
Fixes: #96941 parent fd8a305 commit 7f6e473
1 file changed
+5
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1728 | 1728 | | |
1729 | 1729 | | |
1730 | 1730 | | |
1731 | | - | |
1732 | | - | |
| 1731 | + | |
| 1732 | + | |
| 1733 | + | |
1733 | 1734 | | |
1734 | 1735 | | |
1735 | | - | |
1736 | | - | |
| 1736 | + | |
| 1737 | + | |
1737 | 1738 | | |
1738 | 1739 | | |
1739 | 1740 | | |
| |||
0 commit comments