mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 16:40:24 +08:00 
			
		
		
		
	#2842 add quotes to attachment file name
This commit is contained in:
		@@ -25,7 +25,7 @@ func ServeData(ctx *context.Context, name string, reader io.Reader) error {
 | 
			
		||||
	if !isTextFile {
 | 
			
		||||
		_, isImageFile := base.IsImageFile(buf)
 | 
			
		||||
		if !isImageFile {
 | 
			
		||||
			ctx.Resp.Header().Set("Content-Disposition", "attachment; filename="+path.Base(ctx.Repo.TreeName))
 | 
			
		||||
			ctx.Resp.Header().Set("Content-Disposition", "attachment; filename=\""+path.Base(ctx.Repo.TreeName)+"\"")
 | 
			
		||||
			ctx.Resp.Header().Set("Content-Transfer-Encoding", "binary")
 | 
			
		||||
		}
 | 
			
		||||
	} else {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user