From 5b1af499e0a17977b7b143b60596007a3e8ef65f Mon Sep 17 00:00:00 2001 From: Marcin Rataj Date: Fri, 10 Jan 2025 20:40:01 +0100 Subject: [PATCH] fix(NewClient): support https:// URLs We don't hardcode any specific ports, but assume `http://` (backward-compatible behavior) unless `https://` is passed (then we keep it as-is). --- http/client.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/http/client.go b/http/client.go index 14ae8e4c..cd0e8508 100644 --- a/http/client.go +++ b/http/client.go @@ -85,7 +85,8 @@ func ClientWithRawAbsPath(rawAbsPath bool) ClientOpt { // NewClient constructs a new HTTP-backed command executor. func NewClient(address string, opts ...ClientOpt) cmds.Executor { - if !strings.HasPrefix(address, "http://") { + // default to HTTP to keep backward-compatible behavior, but keep https:// if passed + if !strings.HasPrefix(address, "http:") && !strings.HasPrefix(address, "https:") { address = "http://" + address }