Commit 30aafb6
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 30aafb6
1 file changed
+9
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1535 | 1535 | | |
1536 | 1536 | | |
1537 | 1537 | | |
1538 | | - | |
1539 | | - | |
1540 | | - | |
| 1538 | + | |
| 1539 | + | |
| 1540 | + | |
| 1541 | + | |
1541 | 1542 | | |
1542 | 1543 | | |
1543 | 1544 | | |
| |||
1728 | 1729 | | |
1729 | 1730 | | |
1730 | 1731 | | |
1731 | | - | |
1732 | | - | |
| 1732 | + | |
| 1733 | + | |
| 1734 | + | |
1733 | 1735 | | |
1734 | 1736 | | |
1735 | | - | |
1736 | | - | |
| 1737 | + | |
| 1738 | + | |
1737 | 1739 | | |
1738 | 1740 | | |
1739 | 1741 | | |
| |||
0 commit comments