Skip to content

Commit 2c5b3c7

Browse files
authored
Fix bug with globally disabling mirror (#11760)
Ensure we return after `ctx.Error(...)`
1 parent 0cb2212 commit 2c5b3c7

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

routers/api/v1/misc/settings.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
package misc
66

77
import (
8+
"net/http"
9+
810
"code.gitea.io/gitea/modules/context"
911
"code.gitea.io/gitea/modules/setting"
1012
)
@@ -19,5 +21,5 @@ func SettingGetsAllowedReactions(ctx *context.APIContext) {
1921
// responses:
2022
// "200":
2123
// "$ref": "#/responses/StringSlice"
22-
ctx.JSON(200, setting.UI.Reactions)
24+
ctx.JSON(http.StatusOK, setting.UI.Reactions)
2325
}

routers/api/v1/repo/migrate.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ func Migrate(ctx *context.APIContext, form auth.MigrateRepoForm) {
115115

116116
if form.Mirror && setting.Repository.DisableMirrors {
117117
ctx.Error(http.StatusForbidden, "MirrorsGlobalDisabled", fmt.Errorf("the site administrator has disabled mirrors"))
118+
return
118119
}
119120

120121
var opts = migrations.MigrateOptions{

0 commit comments

Comments
 (0)