From bb14c97d406e5ed49863c666897da890e600a3f3 Mon Sep 17 00:00:00 2001 From: Lauris BH Date: Thu, 20 Apr 2017 05:38:56 +0300 Subject: [PATCH] Fix empty file download (#1506) --- routers/repo/download.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routers/repo/download.go b/routers/repo/download.go index 85e9fc64c97..8b1bb7f952b 100644 --- a/routers/repo/download.go +++ b/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] }