Skip to content

Commit

Permalink
update github tarballtemplate
Browse files Browse the repository at this point in the history
The old tarball url generates a 302 redirect to https://codeload.github.com, it's troublesome for tools (like curl) which do not automatically follow redirect response.

Fixes: #34
Credit: @huochunpeng
  • Loading branch information
3cp authored and iarna committed Jul 6, 2018
1 parent 729a5a0 commit 53ee674
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion git-host-info.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ var gitHosts = module.exports = {
'filetemplate': 'https://{auth@}raw.githubusercontent.com/{user}/{project}/{committish}/{path}',
'bugstemplate': 'https://{domain}/{user}/{project}/issues',
'gittemplate': 'git://{auth@}{domain}/{user}/{project}.git{#committish}',
'tarballtemplate': 'https://{domain}/{user}/{project}/archive/{committish}.tar.gz'
'tarballtemplate': 'https://codeload.{domain}/{user}/{project}/tar.gz/{committish}'
},
bitbucket: {
'protocols': [ 'git+ssh', 'git+https', 'ssh', 'https' ],
Expand Down
2 changes: 1 addition & 1 deletion test/github.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ test('fromUrl(github url)', function (t) {
t.is(hostinfo.sshurl(), 'git+ssh://git@github.com/111/222.git' + hash, label + ' -> sshurl')
t.is(hostinfo.shortcut(), 'github:111/222' + hash, label + ' -> shortcut')
t.is(hostinfo.file('C'), 'https://raw.githubusercontent.com/111/222/' + (branch || 'master') + '/C', label + ' -> file')
t.is(hostinfo.tarball(), 'https://github.com/111/222/archive/' + (branch || 'master') + '.tar.gz', label + ' -> tarball')
t.is(hostinfo.tarball(), 'https://codeload.github.com/111/222/tar.gz/' + (branch || 'master'), label + ' -> tarball')
}

// github shorturls
Expand Down

0 comments on commit 53ee674

Please sign in to comment.