gitea/routers/api/v1/repo
vincent 35d5e4aea4
Fix content size does not match error when uploading lfs file (#29259)
![image](https://github.com/go-gitea/gitea/assets/38434877/cd726b4d-4771-4547-8aee-ae4e4b56b1d1)
When we update an lfs file by API
`api/v1/repos/{owner}/{repo}/contents/{filepath}`, there will show an
error

```json
{
  "message": "Put \"05904d6c7b16bb9b29587100ab1414\": readfrom tcp [::1]:57300->[::1]:9000: content size does not match",
  "url": "http://localhost:3000/api/swagger"
}
```

The reason of this error is
https://github.com/go-gitea/gitea/blob/main/services/repository/files/update.go,
in this file, the `file.ContentReader` been used twice. So when use
`file.ContentReader` in the second time, the `i` of this Reader has been
updated to the length of the content. it will return 0 and an `io.EOF`
error when we try to read cotent from this Reader.
2024-02-19 14:50:03 +00:00
..
action.go
avatar.go
blob.go
branch.go Simplify how git repositories are opened (#28937) 2024-01-27 21:09:51 +01:00
collaborators.go Move more functions to db.Find (#28419) 2024-01-15 02:19:25 +00:00
commits.go Update tool dependencies (#29030) 2024-02-02 19:11:39 -05:00
file.go Fix content size does not match error when uploading lfs file (#29259) 2024-02-19 14:50:03 +00:00
fork.go
git_hook.go
git_ref.go
hook.go
hook_test.go
issue.go
issue_attachment.go
issue_comment.go Refactor locale&string&template related code (#29165) 2024-02-14 21:48:45 +00:00
issue_comment_attachment.go
issue_dependency.go
issue_label.go
issue_pin.go
issue_reaction.go
issue_stopwatch.go
issue_subscription.go
issue_tracked_time.go
key.go
label.go
language.go
main_test.go
migrate.go
milestone.go
mirror.go
notes.go
patch.go
pull.go Simplify how git repositories are opened (#28937) 2024-01-27 21:09:51 +01:00
pull_review.go Simplify how git repositories are opened (#28937) 2024-01-27 21:09:51 +01:00
release.go Move more functions to db.Find (#28419) 2024-01-15 02:19:25 +00:00
release_attachment.go
release_tags.go
repo.go Add merge style `fast-forward-only` (#28954) 2024-02-12 23:37:23 +01:00
repo_test.go Add merge style `fast-forward-only` (#28954) 2024-02-12 23:37:23 +01:00
runners.go
star.go
status.go Fix `GetCommitStatuses` (#28787) 2024-01-15 14:07:32 +00:00
subscriber.go
tag.go
teams.go
topic.go
transfer.go Move some repository transfer functions to service layer (#28855) 2024-02-05 06:17:23 +00:00
tree.go
wiki.go Fix an actions schedule bug (#28942) 2024-01-31 14:55:12 +00:00