From c84a1aebafb19ee78abee7d6be78a886d8222051 Mon Sep 17 00:00:00 2001 From: kovalu Date: Fri, 4 Dec 2020 21:33:59 +0100 Subject: [PATCH] Fix signature calculation for URL encoded characters --- .../binance/api/client/security/AuthenticationInterceptor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/binance/api/client/security/AuthenticationInterceptor.java b/src/main/java/com/binance/api/client/security/AuthenticationInterceptor.java index 197aaabcb..ed1fa6ad5 100755 --- a/src/main/java/com/binance/api/client/security/AuthenticationInterceptor.java +++ b/src/main/java/com/binance/api/client/security/AuthenticationInterceptor.java @@ -43,7 +43,7 @@ public Response intercept(Chain chain) throws IOException { // Endpoint requires signing the payload if (isSignatureRequired) { - String payload = original.url().query(); + String payload = original.url().encodedQuery(); if (!StringUtils.isEmpty(payload)) { String signature = HmacSHA256Signer.sign(payload, secret); HttpUrl signedUrl = original.url().newBuilder().addQueryParameter("signature", signature).build();