@@ -197,13 +197,22 @@ func ToBranchProtection(ctx context.Context, bp *git_model.ProtectedBranch, repo
197197
198198// ToTag convert a git.Tag to an api.Tag
199199func ToTag (repo * repo_model.Repository , t * git.Tag ) * api.Tag {
200+ tarballURL := util .URLJoin (repo .HTMLURL (), "archive" , t .Name + ".tar.gz" )
201+ zipballURL := util .URLJoin (repo .HTMLURL (), "archive" , t .Name + ".zip" )
202+
203+ // Archive URLs are "" if the download feature is disabled
204+ if setting .Repository .DisableDownloadSourceArchives {
205+ tarballURL = ""
206+ zipballURL = ""
207+ }
208+
200209 return & api.Tag {
201210 Name : t .Name ,
202211 Message : strings .TrimSpace (t .Message ),
203212 ID : t .ID .String (),
204213 Commit : ToCommitMeta (repo , t ),
205- ZipballURL : util . URLJoin ( repo . HTMLURL (), "archive" , t . Name + ".zip" ) ,
206- TarballURL : util . URLJoin ( repo . HTMLURL (), "archive" , t . Name + ".tar.gz" ) ,
214+ ZipballURL : zipballURL ,
215+ TarballURL : tarballURL ,
207216 }
208217}
209218
@@ -307,6 +316,7 @@ func ToPublicKey(apiLink string, key *asymkey_model.PublicKey) *api.PublicKey {
307316 Title : key .Name ,
308317 Fingerprint : key .Fingerprint ,
309318 Created : key .CreatedUnix .AsTime (),
319+ Updated : key .UpdatedUnix .AsTime (),
310320 }
311321}
312322
0 commit comments