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

Fix #31640
pull/28966/head^2
Lunny Xiao 3 months ago committed by GitHub
parent d1426de1a4
commit d158472a5a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 6
      routers/web/repo/setting/setting.go

@ -240,7 +240,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
@ -401,7 +402,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