mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 08:30:25 +08:00 
			
		
		
		
	Fix lfs preview bug (#14428)
This commit is contained in:
		@@ -10,6 +10,7 @@ import (
 | 
				
			|||||||
	"encoding/base64"
 | 
						"encoding/base64"
 | 
				
			||||||
	"fmt"
 | 
						"fmt"
 | 
				
			||||||
	gotemplate "html/template"
 | 
						gotemplate "html/template"
 | 
				
			||||||
 | 
						"io"
 | 
				
			||||||
	"io/ioutil"
 | 
						"io/ioutil"
 | 
				
			||||||
	"net/url"
 | 
						"net/url"
 | 
				
			||||||
	"path"
 | 
						"path"
 | 
				
			||||||
@@ -435,7 +436,9 @@ func renderFile(ctx *context.Context, entry *git.TreeEntry, treeLink, rawLink st
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
			buf = make([]byte, 1024)
 | 
								buf = make([]byte, 1024)
 | 
				
			||||||
			n, err = dataRc.Read(buf)
 | 
								n, err = dataRc.Read(buf)
 | 
				
			||||||
			if err != nil {
 | 
								// Error EOF don't mean there is an error, it just means we read to
 | 
				
			||||||
 | 
								// the end
 | 
				
			||||||
 | 
								if err != nil && err != io.EOF {
 | 
				
			||||||
				ctx.ServerError("Data", err)
 | 
									ctx.ServerError("Data", err)
 | 
				
			||||||
				return
 | 
									return
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user