You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gitea/services
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.
12 months ago
..
actions Show commit status for releases (#29149) 12 months ago
agit Adjust object format interface (#28469) 1 year ago
asymkey Simplify how git repositories are opened (#28937) 1 year ago
attachment Even more `db.DefaultContext` refactor (#27352) 1 year ago
auth Fix c/p error in inline documentation (#29148) 12 months ago
automerge Simplify how git repositories are opened (#28937) 1 year ago
context Another round of `db.DefaultContext` refactor (#27103) 1 year ago
convert Add merge style `fast-forward-only` (#28954) 12 months ago
cron Refactor locale&string&template related code (#29165) 12 months ago
doctor Simplify how git repositories are opened (#28937) 1 year ago
externalaccount Final round of `db.DefaultContext` refactor (#27587) 1 year ago
feed More `db.DefaultContext` refactor (#27265) 1 year ago
forms Refactor locale&string&template related code (#29165) 12 months ago
gitdiff Add option to disable ambiguous unicode characters detection (#28454) 1 year ago
indexer Fix missing issue search index update when changing status (#28325) 1 year ago
issue Refactor issue template parsing and fix API endpoint (#29069) 12 months ago
lfs Remove GetByBean method because sometimes it's danger when query condition parameter is zero and also introduce new generic methods (#28220) 1 year ago
mailer Refactor locale&string&template related code (#29165) 12 months ago
markup make writing main test easier (#27270) 1 year ago
migrations Simplify how git repositories are opened (#28937) 1 year ago
mirror Simplify how git repositories are opened (#28937) 1 year ago
notify Update status and code index after changing the default branch (#27018) 1 year ago
org Delete repos of org when purge delete user (#27273) 1 year ago
packages Use general token signing secret (#29205) 12 months ago
pull Disallow merge when required checked are missing (#29143) 12 months ago
release Avoid sending update/delete release notice when it is draft (#29008) 1 year ago
repository Fix content size does not match error when uploading lfs file (#29259) 12 months ago
secrets Refactor deletion (#28610) 1 year ago
task Fix incorrect ctx usage in defer function (#27740) 1 year ago
uinotification Penultimate round of `db.DefaultContext` refactor (#27414) 1 year ago
user Unify password changing and invalidate auth tokens (#27625) 1 year ago
webhook Abstract hash function usage (#28138) 1 year ago
wiki Fix an actions schedule bug (#28942) 1 year ago