From 293d81168ef6be5f65891977df96c9ff77ce64f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacek=20Go=C5=82da?= Date: Sun, 3 Mar 2024 00:37:28 +0100 Subject: [PATCH] IamAwsProvider: fix custom endpoint having non-default port (#1523) --- api/src/main/java/io/minio/credentials/IamAwsProvider.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/api/src/main/java/io/minio/credentials/IamAwsProvider.java b/api/src/main/java/io/minio/credentials/IamAwsProvider.java index feaeb4e4e..08abb1050 100644 --- a/api/src/main/java/io/minio/credentials/IamAwsProvider.java +++ b/api/src/main/java/io/minio/credentials/IamAwsProvider.java @@ -140,6 +140,7 @@ private String fetchImdsToken() { new HttpUrl.Builder() .scheme(url.scheme()) .host(url.host()) + .port(url.port()) .addPathSegments("latest/api/token") .build(); } @@ -188,6 +189,7 @@ private HttpUrl getIamRoleNamedUrl(String token) { new HttpUrl.Builder() .scheme(url.scheme()) .host(url.host()) + .port(url.port()) .addPathSegments("latest/meta-data/iam/security-credentials/") .build(); }