Skip to content

Commit 0a91655

Browse files
lunny6543
authored andcommitted
Fix lfs preview bug (go-gitea#14428)
1 parent fb274ec commit 0a91655

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

routers/repo/view.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010
"encoding/base64"
1111
"fmt"
1212
gotemplate "html/template"
13+
"io"
1314
"io/ioutil"
1415
"net/url"
1516
"path"
@@ -420,7 +421,9 @@ func renderFile(ctx *context.Context, entry *git.TreeEntry, treeLink, rawLink st
420421

421422
buf = make([]byte, 1024)
422423
n, err = dataRc.Read(buf)
423-
if err != nil {
424+
// Error EOF don't mean there is an error, it just means we read to
425+
// the end
426+
if err != nil && err != io.EOF {
424427
ctx.ServerError("Data", err)
425428
return
426429
}

0 commit comments

Comments
 (0)