mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 08:30:25 +08:00 
			
		
		
		
	#2283 set text/plain for non-binary files in raw mode
This commit is contained in:
		@@ -28,6 +28,8 @@ func ServeData(ctx *middleware.Context, name string, reader io.Reader) error {
 | 
			
		||||
			ctx.Resp.Header().Set("Content-Disposition", "attachment; filename="+path.Base(ctx.Repo.TreeName))
 | 
			
		||||
			ctx.Resp.Header().Set("Content-Transfer-Encoding", "binary")
 | 
			
		||||
		}
 | 
			
		||||
	} else {
 | 
			
		||||
		ctx.Resp.Header().Set("Content-Type", "text/plain")
 | 
			
		||||
	}
 | 
			
		||||
	ctx.Resp.Write(buf)
 | 
			
		||||
	_, err := io.Copy(ctx.Resp, reader)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user