From 81b4ae5661b1d3c934169f7ffb764f0b3912ab4d Mon Sep 17 00:00:00 2001 From: Qiaochu Hu <110hqc@gmail.com> Date: Sun, 10 May 2026 20:45:53 +0800 Subject: [PATCH] Fix silently ignored error when saving outbound test URL setting (#4209) In the Xray settings update handler, the error from SetXrayOutboundTestUrl was silently discarded. If the database write failed, the user received a success toast ("Settings updated successfully") but the outbound test URL was not actually saved. Now properly checks the error and returns a failure response to the user, consistent with how the preceding SaveXraySetting call is handled. --- web/controller/xray_setting.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/web/controller/xray_setting.go b/web/controller/xray_setting.go index f161c5eb..db3cfdda 100644 --- a/web/controller/xray_setting.go +++ b/web/controller/xray_setting.go @@ -104,7 +104,10 @@ func (a *XraySettingController) updateSetting(c *gin.Context) { if outboundTestUrl == "" { outboundTestUrl = "https://www.google.com/generate_204" } - _ = a.SettingService.SetXrayOutboundTestUrl(outboundTestUrl) + if err := a.SettingService.SetXrayOutboundTestUrl(outboundTestUrl); err != nil { + jsonMsg(c, I18nWeb(c, "pages.settings.toasts.modifySettings"), err) + return + } jsonMsg(c, I18nWeb(c, "pages.settings.toasts.modifySettings"), nil) }