mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 08:30:25 +08:00 
			
		
		
		
	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:
		@@ -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
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user