diff --git a/routers/web/repo/setting/setting.go b/routers/web/repo/setting/setting.go index 1e0349cdeec..a7fd9a3de45 100644 --- a/routers/web/repo/setting/setting.go +++ b/routers/web/repo/setting/setting.go @@ -248,7 +248,8 @@ func SettingsPost(ctx *context.Context) { remoteAddress, err := util.SanitizeURL(form.MirrorAddress) if err != nil { - ctx.ServerError("SanitizeURL", err) + ctx.Data["Err_MirrorAddress"] = true + handleSettingRemoteAddrError(ctx, err, form) return } pullMirror.RemoteAddress = remoteAddress @@ -409,7 +410,8 @@ func SettingsPost(ctx *context.Context) { remoteAddress, err := util.SanitizeURL(form.PushMirrorAddress) if err != nil { - ctx.ServerError("SanitizeURL", err) + ctx.Data["Err_PushMirrorAddress"] = true + handleSettingRemoteAddrError(ctx, err, form) return }