Handle insecure and ports in go get (#7041)

* Handle insecure and ports in go get

* Fix IsExternalURL for non-standard ports
This commit is contained in:
zeripath
2019-05-27 22:08:38 +01:00
committed by GitHub
parent 9ca7fcddbb
commit 69d81b6569
4 changed files with 16 additions and 4 deletions

View File

@ -188,7 +188,10 @@ func RetrieveBaseRepo(ctx *Context, repo *models.Repository) {
// ComposeGoGetImport returns go-get-import meta content.
func ComposeGoGetImport(owner, repo string) string {
return path.Join(setting.Domain, setting.AppSubURL, url.PathEscape(owner), url.PathEscape(repo))
/// setting.AppUrl is guaranteed to be parse as url
appURL, _ := url.Parse(setting.AppURL)
return path.Join(appURL.Host, setting.AppSubURL, url.PathEscape(owner), url.PathEscape(repo))
}
// EarlyResponseForGoGetMeta responses appropriate go-get meta with status 200