Skip to content

Commit

Permalink
Fix bug with globally disabling mirror (#11760)
Browse files Browse the repository at this point in the history
Ensure we return after `ctx.Error(...)`
  • Loading branch information
6543 authored Jun 4, 2020
1 parent 0cb2212 commit 2c5b3c7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion routers/api/v1/misc/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
package misc

import (
"net/http"

"code.gitea.io/gitea/modules/context"
"code.gitea.io/gitea/modules/setting"
)
Expand All @@ -19,5 +21,5 @@ func SettingGetsAllowedReactions(ctx *context.APIContext) {
// responses:
// "200":
// "$ref": "#/responses/StringSlice"
ctx.JSON(200, setting.UI.Reactions)
ctx.JSON(http.StatusOK, setting.UI.Reactions)
}
1 change: 1 addition & 0 deletions routers/api/v1/repo/migrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ func Migrate(ctx *context.APIContext, form auth.MigrateRepoForm) {

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

var opts = migrations.MigrateOptions{
Expand Down

0 comments on commit 2c5b3c7

Please sign in to comment.