diff --git a/pom.xml b/pom.xml index f5e7148..7da17b0 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.tuya tuya-connector pom - 1.4.0 + 1.4.3 tuya-api tuya-messaging @@ -17,7 +17,7 @@ 1.8 1.8 - 1.3.6 + 1.4.2 5.7.0 1.18.26 1.2.3 diff --git a/tuya-api/pom.xml b/tuya-api/pom.xml index 65b2cca..e5ab591 100644 --- a/tuya-api/pom.xml +++ b/tuya-api/pom.xml @@ -6,7 +6,7 @@ com.tuya tuya-connector - 1.4.0 + 1.4.3 tuya-api diff --git a/tuya-api/src/main/java/com/tuya/connector/open/api/header/TuyaHeaderProcessor.java b/tuya-api/src/main/java/com/tuya/connector/open/api/header/TuyaHeaderProcessor.java index c09cba3..4243a99 100644 --- a/tuya-api/src/main/java/com/tuya/connector/open/api/header/TuyaHeaderProcessor.java +++ b/tuya-api/src/main/java/com/tuya/connector/open/api/header/TuyaHeaderProcessor.java @@ -107,17 +107,18 @@ private String stringToSign(HttpRequest request, Map headers) { lines.add(bodyHash); lines.add(headerLine); URL url = request.getUrl(); - String paramSortedPath = getPathAndSortParam(url); + String paramSortedPath = getPathAndSortParam(request); lines.add(paramSortedPath); return String.join("\n", lines); } @SneakyThrows - private String getPathAndSortParam(URL url) { + private String getPathAndSortParam(HttpRequest request) { + String originalPath = request.originalPath(); + URL url = request.getUrl(); String query = url.getQuery(); - String path = url.getPath(); if(!StringUtils.hasText(query)){ - return decode(path); + return originalPath; } Map kvMap = new TreeMap<>(); String[] kvs = query.split("\\&"); @@ -129,7 +130,7 @@ private String getPathAndSortParam(URL url) { kvMap.put(kvArr[0],""); } } - return decode(path) + "?" + kvMap.entrySet().stream().map(it->it.getKey()+"="+ encode(it.getValue())) + return originalPath + "?" + kvMap.entrySet().stream().map(it->it.getKey()+"="+ encode(it.getValue())) .collect(Collectors.joining("&")); } diff --git a/tuya-common/pom.xml b/tuya-common/pom.xml index 66a24be..ad97363 100644 --- a/tuya-common/pom.xml +++ b/tuya-common/pom.xml @@ -6,7 +6,7 @@ com.tuya tuya-connector - 1.4.0 + 1.4.3 tuya-common diff --git a/tuya-messaging/pom.xml b/tuya-messaging/pom.xml index e971519..f4765aa 100644 --- a/tuya-messaging/pom.xml +++ b/tuya-messaging/pom.xml @@ -6,7 +6,7 @@ com.tuya tuya-connector - 1.4.0 + 1.4.3 tuya-messaging diff --git a/tuya-spring-boot-starter/pom.xml b/tuya-spring-boot-starter/pom.xml index 7929fb9..140145c 100644 --- a/tuya-spring-boot-starter/pom.xml +++ b/tuya-spring-boot-starter/pom.xml @@ -6,7 +6,7 @@ tuya-connector com.tuya - 1.4.0 + 1.4.3 tuya-spring-boot-starter