mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-07 05:39:32 +02:00
Some code improvements (#14266)
This commit is contained in:
1 parent
8688c2be95
commit
3c96a37162
5 files changed
+17
-3
No files matched your search
@@ -413,9 +413,8 @@ func PutHandler(ctx *context.Context) {
|
||||
}
|
||||
|
||||
contentStore := &ContentStore{ObjectStorage: storage.LFS}
|
||||
bodyReader := ctx.Req.Body().ReadCloser()
|
||||
defer bodyReader.Close()
|
||||
if err := contentStore.Put(meta, bodyReader); err != nil {
|
||||
defer ctx.Req.Request.Body.Close()
|
||||
if err := contentStore.Put(meta, ctx.Req.Request.Body); err != nil {
|
||||
// Put will log the error itself
|
||||
ctx.Resp.WriteHeader(500)
|
||||
if err == errSizeMismatch || err == errHashMismatch {
|
||||
|
||||
Reference in new issue
Block a user