File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 1
- // Copyright 2020 The Gitea Authors. All rights reserved.
1
+ // Copyright 2021 The Gitea Authors. All rights reserved.
2
2
// Use of this source code is governed by a MIT-style
3
3
// license that can be found in the LICENSE file.
4
4
5
5
package lfs
6
6
7
7
import (
8
8
"encoding/base64"
9
+ "errors"
9
10
"fmt"
10
11
"io"
11
12
"net/http"
@@ -291,7 +292,7 @@ func UploadHandler(ctx *context.Context) {
291
292
292
293
defer ctx .Req .Body .Close ()
293
294
if err := contentStore .Put (meta .Pointer , ctx .Req .Body ); err != nil {
294
- if err == lfs_module .ErrSizeMismatch || err == lfs_module .ErrHashMismatch {
295
+ if errors . Is ( err , lfs_module .ErrSizeMismatch ) || errors . Is ( err , lfs_module .ErrHashMismatch ) {
295
296
writeStatusMessage (ctx , http .StatusUnprocessableEntity , err .Error ())
296
297
} else {
297
298
writeStatus (ctx , http .StatusInternalServerError )
You can’t perform that action at this time.
0 commit comments