mirror of
https://github.com/go-gitea/gitea.git
synced 2024-10-29 08:17:31 -04:00
Fix empty file download (#1506)
This commit is contained in:
parent
fa2a513c62
commit
bb14c97d40
@ -19,7 +19,7 @@ import (
|
|||||||
func ServeData(ctx *context.Context, name string, reader io.Reader) error {
|
func ServeData(ctx *context.Context, name string, reader io.Reader) error {
|
||||||
buf := make([]byte, 1024)
|
buf := make([]byte, 1024)
|
||||||
n, _ := reader.Read(buf)
|
n, _ := reader.Read(buf)
|
||||||
if n > 0 {
|
if n >= 0 {
|
||||||
buf = buf[:n]
|
buf = buf[:n]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user