aboutsummaryrefslogtreecommitdiffstats
path: root/routers/web/repo/setting
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2024-08-21 09:54:55 +0800
committerGitHub <noreply@github.com>2024-08-21 01:54:55 +0000
commitd158472a5a9ead8052095b153821a9f26c294452 (patch)
treebe007d22e1bfea546badeab2be177976c0715113 /routers/web/repo/setting
parentd1426de1a4a1a52125a35c8e5d1d545c6b9f6f2b (diff)
downloadgitea-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.go6
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
}