Skip to content

Commit

Permalink
Don't return 500 if mirror url contains special chars (go-gitea#31859)
Browse files Browse the repository at this point in the history
  • Loading branch information
lunny committed Aug 21, 2024
1 parent d1426de commit d158472
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions routers/web/repo/setting/setting.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
}

Expand Down

0 comments on commit d158472

Please sign in to comment.