File tree Expand file tree Collapse file tree 3 files changed +7
-6
lines changed Expand file tree Collapse file tree 3 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -583,5 +583,5 @@ func SetDefaultBranch(ctx *gitea_context.PrivateContext) {
583
583
})
584
584
return
585
585
}
586
- ctx .PlainText (200 , []byte ("success" ))
586
+ ctx .PlainText (http . StatusOK , []byte ("success" ))
587
587
}
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ func UpdatePublicKeyInRepo(ctx *context.PrivateContext) {
27
27
deployKey , err := models .GetDeployKeyByRepo (keyID , repoID )
28
28
if err != nil {
29
29
if models .IsErrDeployKeyNotExist (err ) {
30
- ctx .PlainText (200 , []byte ("success" ))
30
+ ctx .PlainText (http . StatusOK , []byte ("success" ))
31
31
return
32
32
}
33
33
ctx .JSON (http .StatusInternalServerError , map [string ]interface {}{
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ package private
6
6
7
7
import (
8
8
"io/ioutil"
9
+ "net/http"
9
10
10
11
myCtx "code.gitea.io/gitea/modules/context"
11
12
"code.gitea.io/gitea/modules/migrations"
@@ -17,7 +18,7 @@ func RestoreRepo(ctx *myCtx.PrivateContext) {
17
18
json := jsoniter .ConfigCompatibleWithStandardLibrary
18
19
bs , err := ioutil .ReadAll (ctx .Req .Body )
19
20
if err != nil {
20
- ctx .JSON (500 , map [string ]string {
21
+ ctx .JSON (http . StatusInternalServerError , map [string ]string {
21
22
"err" : err .Error (),
22
23
})
23
24
return
@@ -29,7 +30,7 @@ func RestoreRepo(ctx *myCtx.PrivateContext) {
29
30
Units []string
30
31
}{}
31
32
if err = json .Unmarshal (bs , & params ); err != nil {
32
- ctx .JSON (500 , map [string ]string {
33
+ ctx .JSON (http . StatusInternalServerError , map [string ]string {
33
34
"err" : err .Error (),
34
35
})
35
36
return
@@ -42,10 +43,10 @@ func RestoreRepo(ctx *myCtx.PrivateContext) {
42
43
params .RepoName ,
43
44
params .Units ,
44
45
); err != nil {
45
- ctx .JSON (500 , map [string ]string {
46
+ ctx .JSON (http . StatusInternalServerError , map [string ]string {
46
47
"err" : err .Error (),
47
48
})
48
49
} else {
49
- ctx .Status (200 )
50
+ ctx .Status (http . StatusOK )
50
51
}
51
52
}
You can’t perform that action at this time.
0 commit comments