From 43f21c0b412b7a8701fe7a2ea6510c5b985a53d6 Mon Sep 17 00:00:00 2001 From: xishang0128 Date: Mon, 2 Sep 2024 16:18:28 +0800 Subject: [PATCH] fix: fallback cannot be unfixed --- hub/route/groups.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/hub/route/groups.go b/hub/route/groups.go index 30dec5f0..c4e9501f 100644 --- a/hub/route/groups.go +++ b/hub/route/groups.go @@ -60,9 +60,15 @@ 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("") + switch proxy.(*adapter.Proxy).Type() { + case C.URLTest: + if urlTestGroup, ok := proxy.(*adapter.Proxy).ProxyAdapter.(*outboundgroup.URLTest); ok { + urlTestGroup.ForceSet("") + } + case C.Fallback: + if fallbackGroup, ok := proxy.(*adapter.Proxy).ProxyAdapter.(*outboundgroup.Fallback); ok { + fallbackGroup.ForceSet("") + } } if proxy.(*adapter.Proxy).Type() != C.Selector {