Skip to content

Commit

Permalink
Send empty body to fetch IMDS token in IamAwsProvider.
Browse files Browse the repository at this point in the history
Signed-off-by: Bala.FA <bala.gluster@gmail.com>
  • Loading branch information
balamurugana committed Jul 19, 2021
1 parent 9585da3 commit e41af94
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion api/src/main/java/io/minio/credentials/IamAwsProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,9 @@ private String fetchImdsToken() {
Request request =
new Request.Builder()
.url(url)
.method("PUT", null)
.method(
"PUT",
RequestBody.create(new byte[] {}, MediaType.parse("application/octet-stream")))
.header("X-aws-ec2-metadata-token-ttl-seconds", "21600")
.build();
try (Response response = httpClient.newCall(request).execute()) {
Expand Down

0 comments on commit e41af94

Please sign in to comment.