Skip to content

Commit 54e66c0

Browse files
authored
Merge pull request #9 from pablo-rago/master
Sorting query-string params before signing authorization key.
2 parents 9b58293 + 482f159 commit 54e66c0

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

.gitignore

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,10 @@ local.properties
2626
# Locally stored "Eclipse launch configurations"
2727
*.launch
2828

29-
.vscode
29+
.vscode
30+
31+
######################
32+
# Intellij
33+
######################
34+
.idea/
35+
*.iml

src/main/java/com/cryptomarket/sdk/HttpClientImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public String get(String endpoint, @Nullable Map<String, String> params) throws
8989
URI uri = null;
9090
try {
9191
URIBuilder uriBuilder = new URIBuilder(this.url + this.apiVersion + endpoint);
92-
if (params != null) params.forEach((key, val) -> uriBuilder.addParameter(key, val));
92+
if (params != null) params.entrySet().stream().sorted(Map.Entry.comparingByKey()).forEach(e -> uriBuilder.addParameter(e.getKey(), e.getValue()));
9393
uri = uriBuilder.build();
9494
} catch (URISyntaxException e) {
9595
throw new CryptomarketSDKException("Failed to build the uri", e);

0 commit comments

Comments
 (0)