修复下载接口缺少最后一部分数据的问题
This commit is contained in:
parent
e3cdb1a14f
commit
0addcdeb3a
|
|
@ -51,6 +51,10 @@ func (s *ObjectService) Download(ctx *gin.Context) {
|
|||
ctx.Stream(func(w io.Writer) bool {
|
||||
rd, err := file.Read(buf)
|
||||
if err == io.EOF {
|
||||
err = myio.WriteAll(w, buf[:rd])
|
||||
if err != nil {
|
||||
log.Warnf("writing data to response: %s", err.Error())
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue