From d187124db6db240d53c02edc549a5be7166d2e58 Mon Sep 17 00:00:00 2001 From: Toby Chui Date: Fri, 9 Jun 2023 00:01:11 +0800 Subject: [PATCH] Quick fix on the edit not working bug --- src/reverseproxy.go | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/reverseproxy.go b/src/reverseproxy.go index 5b2da9a..da71ba2 100644 --- a/src/reverseproxy.go +++ b/src/reverseproxy.go @@ -346,6 +346,7 @@ func ReverseProxyHandleEditEndpoint(w http.ResponseWriter, r *http.Request) { RequireBasicAuth: requireBasicAuth, BasicAuthCredentials: targetProxyEntry.BasicAuthCredentials, } + dynamicProxyRouter.RemoveProxy("vdir", thisOption.RootName) dynamicProxyRouter.AddVirtualDirectoryProxyService(&thisOption) } else if eptype == "subd" { @@ -357,6 +358,7 @@ func ReverseProxyHandleEditEndpoint(w http.ResponseWriter, r *http.Request) { RequireBasicAuth: requireBasicAuth, BasicAuthCredentials: targetProxyEntry.BasicAuthCredentials, } + dynamicProxyRouter.RemoveProxy("subd", thisOption.MatchingDomain) dynamicProxyRouter.AddSubdomainRoutingService(&thisOption) } @@ -371,14 +373,6 @@ func ReverseProxyHandleEditEndpoint(w http.ResponseWriter, r *http.Request) { BasicAuthCredentials: targetProxyEntry.BasicAuthCredentials, } SaveReverseProxyConfig(&thisProxyConfigRecord) - - //Update the current running config - targetProxyEntry.Domain = endpoint - targetProxyEntry.RequireTLS = useTLS - targetProxyEntry.SkipCertValidations = skipTlsValidation - targetProxyEntry.RequireBasicAuth = requireBasicAuth - dynamicProxyRouter.SaveProxy(eptype, targetProxyEntry.RootOrMatchingDomain, targetProxyEntry) - utils.SendOK(w) }