1
0
mirror of https://github.com/go-gitea/gitea.git synced 2024-12-04 14:46:57 -05:00

Fix incorrect rendering csv file when file size is larger than UI.CSV.MaxFileSize (#29653) (#29663)

Backport #29653 by @yp05327

Fix #29506

Co-authored-by: yp05327 <576951401@qq.com>
This commit is contained in:
Giteabot 2024-03-08 17:13:58 +08:00 committed by GitHub
parent 76b6754c3a
commit 6651d2d87a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -93,9 +93,11 @@ func (Renderer) Render(ctx *markup.RenderContext, input io.Reader, output io.Wri
if _, err := tmpBlock.WriteString(html.EscapeString(string(rawBytes))); err != nil {
return err
}
_, err = tmpBlock.WriteString("</pre>")
if _, err := tmpBlock.WriteString("</pre>"); err != nil {
return err
}
return tmpBlock.Flush()
}
rd, err := csv.CreateReaderAndDetermineDelimiter(ctx, bytes.NewReader(rawBytes))
if err != nil {