fix(upgrader): github proxy for downloading digest

This commit is contained in:
0xJacky 2024-01-29 20:16:55 +08:00
parent de8d6073a3
commit 1950d9a86a
No known key found for this signature in database
GPG key ID: B6E4A6E4A561BAF0
2 changed files with 9 additions and 1 deletions

View file

@ -288,6 +288,14 @@ func (u *Upgrader) DownloadLatestRelease(progressChan chan float64) (tarName str
return
}
if settings.ServerSettings.GithubProxy != "" {
digest.BrowserDownloadUrl, err = url.JoinPath(settings.ServerSettings.GithubProxy, digest.BrowserDownloadUrl)
if err != nil {
err = errors.Wrap(err, "service.DownloadLatestRelease url.JoinPath error")
return
}
}
resp, err := http.Get(digest.BrowserDownloadUrl)
if err != nil {