Skip to content

Commit a8dbc33

Browse files
authored
Send empty body to fetch IMDS token in IamAwsProvider. (#1212)
Signed-off-by: Bala.FA <bala.gluster@gmail.com>
1 parent 9585da3 commit a8dbc33

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

api/src/main/java/io/minio/credentials/IamAwsProvider.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
import okhttp3.OkHttpClient;
3636
import okhttp3.Protocol;
3737
import okhttp3.Request;
38+
import okhttp3.RequestBody;
3839
import okhttp3.Response;
3940

4041
/**
@@ -143,7 +144,7 @@ private String fetchImdsToken() {
143144
Request request =
144145
new Request.Builder()
145146
.url(url)
146-
.method("PUT", null)
147+
.method("PUT", RequestBody.create(new byte[] {}, null))
147148
.header("X-aws-ec2-metadata-token-ttl-seconds", "21600")
148149
.build();
149150
try (Response response = httpClient.newCall(request).execute()) {

0 commit comments

Comments
 (0)