Skip to content

Commit

Permalink
Send empty body to fetch IMDS token in IamAwsProvider. (#1212)
Browse files Browse the repository at this point in the history
Signed-off-by: Bala.FA <[email protected]>
  • Loading branch information
balamurugana authored Jul 19, 2021
1 parent 9585da3 commit a8dbc33
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion api/src/main/java/io/minio/credentials/IamAwsProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import okhttp3.OkHttpClient;
import okhttp3.Protocol;
import okhttp3.Request;
import okhttp3.RequestBody;
import okhttp3.Response;

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

0 comments on commit a8dbc33

Please sign in to comment.