Skip to content

Commit

Permalink
Fix signed request path should include query parameters (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandru-ionut-balan committed Aug 2, 2023
1 parent 9a1224f commit b63dad9
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1196,6 +1196,10 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} {
mandatoryHeaders.put("Digest", digest(body == null ? "" : body.toString()));
mandatoryHeaders.put("Date", ZonedDateTime.now(ZoneId.of("GMT")).format(FORMATTER));

if (!queryParams.isEmpty()) {
path = target.getUri().getRawPath() + "?" + target.getUri().getRawQuery();
}

String signature = sign(signer, method.toLowerCase(), path, mandatoryHeaders).toString();

if (!headerParams.containsKey("Authorization")) mandatoryHeaders.put("Authorization", "Bearer " + applicationAccessToken);
Expand Down

0 comments on commit b63dad9

Please sign in to comment.