mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 08:30:25 +08:00 
			
		
		
		
	Fix bug with globally disabling mirror (#11760)
Ensure we return after `ctx.Error(...)`
This commit is contained in:
		@@ -5,6 +5,8 @@
 | 
			
		||||
package misc
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"net/http"
 | 
			
		||||
 | 
			
		||||
	"code.gitea.io/gitea/modules/context"
 | 
			
		||||
	"code.gitea.io/gitea/modules/setting"
 | 
			
		||||
)
 | 
			
		||||
@@ -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)
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -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{
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user