0
0
Fork 0
mirror of https://github.com/go-gitea/gitea synced 2024-11-14 22:11:32 +01:00

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

Fix #31640
This commit is contained in:
Lunny Xiao 2024-08-21 09:54:55 +08:00 committed by GitHub
parent d1426de1a4
commit d158472a5a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -240,7 +240,8 @@ func SettingsPost(ctx *context.Context) {
remoteAddress, err := util.SanitizeURL(form.MirrorAddress) remoteAddress, err := util.SanitizeURL(form.MirrorAddress)
if err != nil { if err != nil {
ctx.ServerError("SanitizeURL", err) ctx.Data["Err_MirrorAddress"] = true
handleSettingRemoteAddrError(ctx, err, form)
return return
} }
pullMirror.RemoteAddress = remoteAddress pullMirror.RemoteAddress = remoteAddress
@ -401,7 +402,8 @@ func SettingsPost(ctx *context.Context) {
remoteAddress, err := util.SanitizeURL(form.PushMirrorAddress) remoteAddress, err := util.SanitizeURL(form.PushMirrorAddress)
if err != nil { if err != nil {
ctx.ServerError("SanitizeURL", err) ctx.Data["Err_PushMirrorAddress"] = true
handleSettingRemoteAddrError(ctx, err, form)
return return
} }