gitea/routers/web/repo
KN4CK3R 1fbdf96c34
Fix CSV render error (#17406) (#17431)
Backport #17406.

Closes #17378 

Both errors from #17378 were caused by  #15175.

Problem 1 (error with added file):
`ToUTF8WithFallbackReader` creates a `MultiReader` from a `byte[2048]` and the remaining reader. `CreateReaderAndGuessDelimiter` tries to read 10000 bytes from this reader but only gets 2048 because that's the first reader in the `MultiReader`. Then the `if size < 1e4` thinks the input is at EOF and just returns that.

Problem 2 (error with changed file):
The blob reader gets defer closed. That was fine because the old version reads the whole file into memory. Now with the streaming version the close needs to defer after the method.

Co-authored-by: zeripath <art27@cantab.net>
2021-10-25 18:31:15 +01:00
..
activity.go
attachment.go Read expected buffer size (#17409) (#17430) 2021-10-25 17:46:56 +01:00
blame.go Link to previous blames in file blame page (#16259) 2021-06-28 01:13:20 +02:00
branch.go Fix branch pagination error (#16805) (#16816) 2021-08-25 11:11:54 +01:00
commit.go Repare and Improve GetDiffRangeWithWhitespaceBehavior (#16894) (#16895) 2021-08-31 05:02:27 +02:00
compare.go Fix CSV render error (#17406) (#17431) 2021-10-25 18:31:15 +01:00
download.go
editor.go Read expected buffer size (#17409) (#17430) 2021-10-25 17:46:56 +01:00
editor_test.go
http.go Fix various documentation, user-facing, and source comment typos (#16367) 2021-07-08 13:38:13 +02:00
http_test.go
issue.go Fix git.Blob.DataAsync(): close pipe since we return a NopCloser (#16899) (#16900) 2021-08-31 16:06:01 +08:00
issue_dependency.go
issue_label.go
issue_label_test.go
issue_lock.go
issue_stopwatch.go
issue_test.go
issue_timetrack.go
issue_watch.go
lfs.go Read expected buffer size (#17409) (#17430) 2021-10-25 17:46:56 +01:00
main_test.go
middlewares.go
migrate.go Add push to remote mirror repository (#15157) 2021-06-14 19:20:43 +02:00
milestone.go In Render tolerate not being passed a context (#16842) (#16858) 2021-08-29 15:25:45 +01:00
projects.go In Render tolerate not being passed a context (#16842) (#16858) 2021-08-29 15:25:45 +01:00
projects_test.go
pull.go Fix stange behavior of DownloadPullDiffOrPatch in incorect index (#17223) (#17227) 2021-10-05 20:16:22 +02:00
pull_review.go Add attachments for PR reviews (#16075) 2021-06-14 21:12:33 -04:00
release.go In Render tolerate not being passed a context (#16842) (#16858) 2021-08-29 15:25:45 +01:00
release_test.go
repo.go Rework repository archive (#14723) 2021-06-23 17:12:38 -04:00
search.go
setting.go Decrement Fork Num when converting from Fork (#17035) (#17046) 2021-09-15 10:05:47 +08:00
setting_protected_branch.go
settings_test.go
tag.go Add tag protection (#15629) 2021-06-25 16:28:55 +02:00
topic.go
view.go Read expected buffer size (#17409) (#17430) 2021-10-25 17:46:56 +01:00
webhook.go Implemented head_commit for webhooks (#16282) 2021-06-29 15:34:03 +02:00
wiki.go Ensure wiki repos are all closed (#16886) (#16888) 2021-08-30 23:00:45 +02:00
wiki_test.go Add TestPrepareWikiFileName (#16487) (#16498) 2021-07-21 03:37:00 +01:00