0
0
Fork 0
mirror of https://github.com/go-gitea/gitea synced 2025-01-03 08:15:32 +01:00
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 \"05904d6c7b\": 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
..
actions Show commit status for releases (#29149) 2024-02-19 10:27:05 +00:00
agit
asymkey Simplify how git repositories are opened (#28937) 2024-01-27 21:09:51 +01:00
attachment
auth Fix c/p error in inline documentation (#29148) 2024-02-19 10:51:58 +00:00
automerge Simplify how git repositories are opened (#28937) 2024-01-27 21:09:51 +01:00
context
convert Add merge style fast-forward-only (#28954) 2024-02-12 23:37:23 +01:00
cron Refactor locale&string&template related code (#29165) 2024-02-14 21:48:45 +00:00
doctor Simplify how git repositories are opened (#28937) 2024-01-27 21:09:51 +01:00
externalaccount
feed
forms Refactor locale&string&template related code (#29165) 2024-02-14 21:48:45 +00:00
gitdiff
indexer
issue Refactor issue template parsing and fix API endpoint (#29069) 2024-02-12 05:04:10 +00:00
lfs
mailer Refactor locale&string&template related code (#29165) 2024-02-14 21:48:45 +00:00
markup
migrations Simplify how git repositories are opened (#28937) 2024-01-27 21:09:51 +01:00
mirror Simplify how git repositories are opened (#28937) 2024-01-27 21:09:51 +01:00
notify
org
packages Use general token signing secret (#29205) 2024-02-18 17:39:04 +00:00
pull Disallow merge when required checked are missing (#29143) 2024-02-19 09:57:08 +00:00
release Avoid sending update/delete release notice when it is draft (#29008) 2024-02-02 04:18:12 +00:00
repository Fix content size does not match error when uploading lfs file (#29259) 2024-02-19 14:50:03 +00:00
secrets
task
uinotification
user Unify password changing and invalidate auth tokens (#27625) 2024-02-04 14:05:26 +00:00
webhook
wiki Fix an actions schedule bug (#28942) 2024-01-31 14:55:12 +00:00