diff options
author | yp05327 <576951401@qq.com> | 2024-03-08 17:44:50 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-08 08:44:50 +0000 |
commit | 9dc8a6336edddca0f3f90392bbc398f4ceaeaf13 (patch) | |
tree | a08ec8e8e1b80f4afd40d84ed4dfb1054f8830f9 /modules | |
parent | f86e9a03673b70d660a4b7a1e53748757d7a45fa (diff) | |
download | gitea-9dc8a6336edddca0f3f90392bbc398f4ceaeaf13.tar.gz gitea-9dc8a6336edddca0f3f90392bbc398f4ceaeaf13.zip |
Fix incorrect rendering csv file when file size is larger than UI.CSV.MaxFileSize (#29653)
Fix #29506
Diffstat (limited to 'modules')
-rw-r--r-- | modules/markup/csv/csv.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/modules/markup/csv/csv.go b/modules/markup/csv/csv.go index 7af34a6cbc..12458e954a 100644 --- a/modules/markup/csv/csv.go +++ b/modules/markup/csv/csv.go @@ -93,8 +93,10 @@ 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>") - return err + if _, err := tmpBlock.WriteString("</pre>"); err != nil { + return err + } + return tmpBlock.Flush() } rd, err := csv.CreateReaderAndDetermineDelimiter(ctx, bytes.NewReader(rawBytes)) |