diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2024-08-21 09:54:55 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-21 01:54:55 +0000 |
commit | d158472a5a9ead8052095b153821a9f26c294452 (patch) | |
tree | be007d22e1bfea546badeab2be177976c0715113 /routers/web/repo/setting | |
parent | d1426de1a4a1a52125a35c8e5d1d545c6b9f6f2b (diff) | |
download | gitea-d158472a5a9ead8052095b153821a9f26c294452.tar.gz gitea-d158472a5a9ead8052095b153821a9f26c294452.zip |
Don't return 500 if mirror url contains special chars (#31859)
Fix #31640
Diffstat (limited to 'routers/web/repo/setting')
-rw-r--r-- | routers/web/repo/setting/setting.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/routers/web/repo/setting/setting.go b/routers/web/repo/setting/setting.go index 3f9140857a..485bd927fa 100644 --- a/routers/web/repo/setting/setting.go +++ b/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 } |