From 1527fd9ffbdbac3d9d88aa5d77a3181a56088667 Mon Sep 17 00:00:00 2001 From: Jamie Magee Date: Thu, 30 Nov 2023 21:41:02 -0800 Subject: [PATCH] Add cross-platform path support for proxy certificates --- internal/infra/proxy.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/internal/infra/proxy.go b/internal/infra/proxy.go index d0c841f..122e072 100644 --- a/internal/infra/proxy.go +++ b/internal/infra/proxy.go @@ -17,7 +17,6 @@ import ( "os" "path" "path/filepath" - "strings" ) const proxyCertPath = "/usr/local/share/ca-certificates/custom-ca-cert.crt" @@ -53,7 +52,7 @@ func NewProxy(ctx context.Context, cli *client.Client, params *RunParams, nets * } hostCfg.ExtraHosts = append(hostCfg.ExtraHosts, params.ExtraHosts...) if params.ProxyCertPath != "" { - if !strings.HasPrefix(params.ProxyCertPath, "/") { + if !path.IsAbs(params.ProxyCertPath) { // needs to be absolute, assume it is relative to the working directory var dir string dir, err = os.Getwd()