Fix empty file download (#1506)

pull/1519/head
Lauris BH 8 years ago committed by Lunny Xiao
parent fa2a513c62
commit bb14c97d40
  1. 2
      routers/repo/download.go

@ -19,7 +19,7 @@ import (
func ServeData(ctx *context.Context, name string, reader io.Reader) error {
buf := make([]byte, 1024)
n, _ := reader.Read(buf)
if n > 0 {
if n >= 0 {
buf = buf[:n]
}

Loading…
Cancel
Save