Skip to content

Commit

Permalink
Make code property check optional in IamAwsProvider
Browse files Browse the repository at this point in the history
Fixes #1108
  • Loading branch information
balamurugana committed Nov 10, 2020
1 parent ffecbaf commit 68a56cf
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions api/src/main/java/io/minio/credentials/IamAwsProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,9 @@ private Credentials fetchCredentials(HttpUrl url) {
}

EcsCredentials creds = mapper.readValue(response.body().charStream(), EcsCredentials.class);
if (!"Success".equals(creds.code())) {
throw new ProviderException(url + " failed with message " + creds.message());
if (creds.code() != null && !creds.code().equals("Success")) {
throw new ProviderException(
url + " failed with code " + creds.code() + " and message " + creds.message());
}
return creds.toCredentials();
} catch (IOException e) {
Expand Down

0 comments on commit 68a56cf

Please sign in to comment.