From 220a6ac115da2545780136b8518164118d280aaf Mon Sep 17 00:00:00 2001 From: Olivier Cazade Date: Wed, 20 Jul 2022 15:13:08 +0200 Subject: [PATCH] Added check for empty ProxyURL Signed-off-by: Olivier Cazade --- config/http_config.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/config/http_config.go b/config/http_config.go index bcda953a..23ac0234 100644 --- a/config/http_config.go +++ b/config/http_config.go @@ -334,6 +334,10 @@ func (c *HTTPClientConfig) Validate() error { return fmt.Errorf("at most one of oauth2 client_secret & client_secret_file must be configured") } } + // Change empty URL to nil to avoid connection errors + if c.ProxyURL.URL != nil && *c.ProxyURL.URL == (url.URL{}) { + c.ProxyURL.URL = nil + } return nil }