From 4f424669f111362644bd010e40279d08d9a6aa2d Mon Sep 17 00:00:00 2001 From: Clark McCauley Date: Thu, 2 Jan 2025 13:29:22 -0700 Subject: [PATCH] Don't add magic cookie to env if unspecified --- client.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/client.go b/client.go index df2fd22..b1291a7 100644 --- a/client.go +++ b/client.go @@ -637,11 +637,13 @@ func (c *Client) Start() (addr net.Addr, err error) { } env := []string{ - fmt.Sprintf("%s=%s", c.config.MagicCookieKey, c.config.MagicCookieValue), fmt.Sprintf("PLUGIN_MIN_PORT=%d", c.config.MinPort), fmt.Sprintf("PLUGIN_MAX_PORT=%d", c.config.MaxPort), fmt.Sprintf("PLUGIN_PROTOCOL_VERSIONS=%s", strings.Join(versionStrings, ",")), } + if len(c.config.MagicCookieKey) > 0 { + env = append(env, fmt.Sprintf("%s=%s", c.config.MagicCookieKey, c.config.MagicCookieValue)) + } if c.config.GRPCBrokerMultiplex { env = append(env, fmt.Sprintf("%s=true", envMultiplexGRPC)) }