Skip to content

Commit

Permalink
adjusting set of access token
Browse files Browse the repository at this point in the history
  • Loading branch information
mariannebiancamb committed Apr 24, 2024
1 parent 9e5d252 commit 336e4c7
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/main/java/com/mercadopago/client/MercadoPagoClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ private Map<String, String> addDefaultHeaders(MPRequest request) {
}

if (!request.getUri().contains(OAUTH_TOKEN) && !headers.containsKey(Headers.AUTHORIZATION)) {
headers.put(Headers.AUTHORIZATION, String.format(BEARER, getAccessToken(null)));
headers.put(Headers.AUTHORIZATION, String.format(BEARER, request.getAccessToken()));
}
return headers;
}
Expand All @@ -298,10 +298,6 @@ private Map<String, String> addCustomHeaders(String uri, MPRequestOptions reques
}
}

if (!uri.contains(OAUTH_TOKEN)) {
headers.put(Headers.AUTHORIZATION, String.format(BEARER, getAccessToken(requestOptions)));
}

return headers;
}

Expand Down

0 comments on commit 336e4c7

Please sign in to comment.