mirror of
1
Fork 0

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

Fix #31640

(cherry picked from commit d158472a5a9ead8052095b153821a9f26c294452)
This commit is contained in:
Lunny Xiao 2024-08-21 09:54:55 +08:00 committed by Gergely Nagy
parent dda53569b1
commit 3ade4d9b2b
No known key found for this signature in database
1 changed files with 4 additions and 2 deletions

View File

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