File tree Expand file tree Collapse file tree 2 files changed +8
-12
lines changed Expand file tree Collapse file tree 2 files changed +8
-12
lines changed Original file line number Diff line number Diff line change @@ -316,9 +316,9 @@ func archiveDownload(ctx *context.APIContext) {
316316		aReq .CommitID ,
317317	))
318318
319- 	if  setting .Repository .StreamArchives  {
320- 		downloadName  :=  ctx .Repo .Repository .Name  +  "-"  +  aReq .GetArchiveName ()
319+ 	downloadName  :=  ctx .Repo .Repository .Name  +  "-"  +  aReq .GetArchiveName ()
321320
321+ 	if  setting .Repository .StreamArchives  {
322322		ctx .SetServeHeaders (& context.ServeHeaderOptions {
323323			Filename : downloadName ,
324324		})
@@ -335,12 +335,10 @@ func archiveDownload(ctx *context.APIContext) {
335335		return 
336336	}
337337
338- 	download (ctx , aReq . GetArchiveName () , archiver )
338+ 	download (ctx , downloadName , archiver )
339339}
340340
341- func  download (ctx  * context.APIContext , archiveName  string , archiver  * repo_model.RepoArchiver ) {
342- 	downloadName  :=  ctx .Repo .Repository .Name  +  "-"  +  archiveName 
343- 
341+ func  download (ctx  * context.APIContext , downloadName  string , archiver  * repo_model.RepoArchiver ) {
344342	rPath  :=  archiver .RelativePath ()
345343	if  setting .RepoArchive .Storage .ServeDirect () {
346344		// If we have a signed url (S3, object storage), redirect to this directly. 
Original file line number Diff line number Diff line change @@ -386,9 +386,9 @@ func Download(ctx *context.Context) {
386386		aReq .CommitID ,
387387	))
388388
389- 	if  setting .Repository .StreamArchives  {
390- 		downloadName  :=  ctx .Repo .Repository .Name  +  "-"  +  aReq .GetArchiveName ()
389+ 	downloadName  :=  ctx .Repo .Repository .Name  +  "-"  +  aReq .GetArchiveName ()
391390
391+ 	if  setting .Repository .StreamArchives  {
392392		ctx .SetServeHeaders (& context.ServeHeaderOptions {
393393			Filename : downloadName ,
394394		})
@@ -405,12 +405,10 @@ func Download(ctx *context.Context) {
405405		return 
406406	}
407407
408- 	download (ctx , aReq . GetArchiveName () , archiver )
408+ 	download (ctx , downloadName , archiver )
409409}
410410
411- func  download (ctx  * context.Context , archiveName  string , archiver  * repo_model.RepoArchiver ) {
412- 	downloadName  :=  ctx .Repo .Repository .Name  +  "-"  +  archiveName 
413- 
411+ func  download (ctx  * context.Context , downloadName  string , archiver  * repo_model.RepoArchiver ) {
414412	rPath  :=  archiver .RelativePath ()
415413	if  setting .RepoArchive .Storage .ServeDirect () {
416414		// If we have a signed url (S3, object storage), redirect to this directly. 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments