From 529d9da7f2786d44912c4ee60e861436ea215a11 Mon Sep 17 00:00:00 2001 From: kartik-579 Date: Tue, 21 May 2024 19:30:15 +0530 Subject: [PATCH 1/2] panic fix --- client/proxy/ProxyRouter.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client/proxy/ProxyRouter.go b/client/proxy/ProxyRouter.go index 545941fcbe..a1b7f47898 100644 --- a/client/proxy/ProxyRouter.go +++ b/client/proxy/ProxyRouter.go @@ -57,9 +57,9 @@ func NewProxyRouterImpl(logger *zap.SugaredLogger, proxyCfg *Config, enforcer ca proxy := make(map[string]func(writer http.ResponseWriter, request *http.Request)) for s, connection := range proxyConnection { proxy[s], err = NewHTTPReverseProxy(fmt.Sprintf("http://%s:%s", connection.Host, connection.Port), client.Transport, enforcer) - } - if err != nil { - return nil, err + if err != nil { + return nil, err + } } router := &ProxyRouterImpl{ From f3c91d2236e07afa2d1841e4cc607f8c37fad914 Mon Sep 17 00:00:00 2001 From: kartik-579 Date: Tue, 21 May 2024 19:55:29 +0530 Subject: [PATCH 2/2] set default for PROXY_SERVICE_CONFIG --- client/proxy/ProxyRouter.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/proxy/ProxyRouter.go b/client/proxy/ProxyRouter.go index a1b7f47898..fa0fce8cb4 100644 --- a/client/proxy/ProxyRouter.go +++ b/client/proxy/ProxyRouter.go @@ -22,7 +22,7 @@ type ProxyConnection struct { } type Config struct { - ProxyServiceConfig string `env:"PROXY_SERVICE_CONFIG" envDefault:""` + ProxyServiceConfig string `env:"PROXY_SERVICE_CONFIG" envDefault:"{}"` } func GetProxyConfig() (*Config, error) {