From b8a60261efb2ebe9f5a1df95f52e9669aa20e28c Mon Sep 17 00:00:00 2001 From: Larvan2 <78135608+Larvan2@users.noreply.github.com> Date: Fri, 18 Aug 2023 22:17:07 +0800 Subject: [PATCH] chore: restore unselected clear selected node in outboundgoup/URLtest when getGroupDelay triggered --- hub/route/groups.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/hub/route/groups.go b/hub/route/groups.go index e5b61fb5..c82207f0 100644 --- a/hub/route/groups.go +++ b/hub/route/groups.go @@ -9,6 +9,7 @@ import ( "time" "github.com/Dreamacro/clash/adapter" + "github.com/Dreamacro/clash/adapter/outboundgroup" "github.com/Dreamacro/clash/common/utils" C "github.com/Dreamacro/clash/constant" "github.com/Dreamacro/clash/tunnel" @@ -57,6 +58,11 @@ func getGroupDelay(w http.ResponseWriter, r *http.Request) { return } + if proxy.(*adapter.Proxy).Type() == C.URLTest { + URLTestGroup := proxy.(*adapter.Proxy).ProxyAdapter.(*outboundgroup.URLTest) + URLTestGroup.ForceSet("") + } + query := r.URL.Query() url := query.Get("url") timeout, err := strconv.ParseInt(query.Get("timeout"), 10, 32) @@ -77,7 +83,6 @@ func getGroupDelay(w http.ResponseWriter, r *http.Request) { defer cancel() dm, err := group.URLTest(ctx, url, expectedStatus) - if err != nil { render.Status(r, http.StatusGatewayTimeout) render.JSON(w, r, newError(err.Error()))