From 488e84bfea8dd28a94a15a7f3eec68b846496759 Mon Sep 17 00:00:00 2001 From: Matt Jones Date: Mon, 12 May 2025 21:29:17 -0500 Subject: [PATCH 1/2] fix: switchbot api is stricter, add missing content-type header --- pom.xml | 2 +- src/main/java/com/bigboxer23/switch_bot/SwitchBotApi.java | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index a3c5c5e..6cda762 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.bigboxer23 switchbotapi-java - 1.2.2 + 1.2.3 switchbotapi-java https://github.com/bigboxer23/switchbotapi-java diff --git a/src/main/java/com/bigboxer23/switch_bot/SwitchBotApi.java b/src/main/java/com/bigboxer23/switch_bot/SwitchBotApi.java index f50c7f4..8698624 100644 --- a/src/main/java/com/bigboxer23/switch_bot/SwitchBotApi.java +++ b/src/main/java/com/bigboxer23/switch_bot/SwitchBotApi.java @@ -65,7 +65,8 @@ protected RequestBuilderCallback addAuth() { builder.addHeader("Authorization", token) .addHeader("sign", signature) .addHeader("nonce", nonce) - .addHeader("t", time); + .addHeader("t", time) + .addHeader("Content-Type", "application/json; charset=utf-8"); } catch (NoSuchAlgorithmException | InvalidKeyException e) { log.warn("exception with auth: ", e); } From e3eecb2211ad7e4a6ca387d00b25a57f0adaaf8a Mon Sep 17 00:00:00 2001 From: Matt Jones Date: Mon, 12 May 2025 21:29:49 -0500 Subject: [PATCH 2/2] fix: switchbot api is stricter, add missing content-type header --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 6cda762..3a6bc8e 100644 --- a/pom.xml +++ b/pom.xml @@ -98,7 +98,7 @@ 4 false ${!integration} - 1 + 1