Don't return 500 if mirror url contains special chars (#31859) (#31895)

Backport #31859
pull/31914/head
Lunny Xiao 3 months ago committed by GitHub
parent d9c65c9a52
commit e060ae88e5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 6
      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
}

Loading…
Cancel
Save