Mint: Strip the default port from SERVER_ENDPOINT in aws-sdk-go tests (#11897)

Having the default port in there makes the test using a presigned
request fail.

Co-authored-by: Robert Lützner <robert.luetzner@iternity.com>
Signed-off-by: Harshavardhana <harsha@minio.io>
This commit is contained in:
iternity-dotcom 2021-04-20 18:41:38 +02:00 committed by Harshavardhana
parent 9ffb5d5b0a
commit 57ae6edeac

View File

@ -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