From 57ae6edeacd1c953f05d3dd399c99766e3cf1485 Mon Sep 17 00:00:00 2001 From: iternity-dotcom <79988904+iternity-dotcom@users.noreply.github.com> Date: Tue, 20 Apr 2021 18:41:38 +0200 Subject: [PATCH] Mint: Strip the default port from SERVER_ENDPOINT in aws-sdk-go tests (#11897) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Having the default port in there makes the test using a presigned request fail. Co-authored-by: Robert Lützner Signed-off-by: Harshavardhana --- mint/run/core/aws-sdk-go/main.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mint/run/core/aws-sdk-go/main.go b/mint/run/core/aws-sdk-go/main.go index 7b4dc9835..7ce01f96d 100644 --- a/mint/run/core/aws-sdk-go/main.go +++ b/mint/run/core/aws-sdk-go/main.go @@ -1069,6 +1069,12 @@ func main() { accessKey := os.Getenv("ACCESS_KEY") secretKey := os.Getenv("SECRET_KEY") secure := os.Getenv("ENABLE_HTTPS") + if strings.HasSuffix(endpoint, ":443") { + endpoint = strings.ReplaceAll(endpoint, ":443", "") + } + if strings.HasSuffix(endpoint, ":80") { + endpoint = strings.ReplaceAll(endpoint, ":80", "") + } sdkEndpoint := "http://" + endpoint if secure == "1" { sdkEndpoint = "https://" + endpoint