Skip to content

Commit f6fb9bd

Browse files
authored
Add content type header (#121)
* fix: switchbot api is stricter, add missing content-type header
1 parent 4e0c178 commit f6fb9bd

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
<groupId>com.bigboxer23</groupId>
66
<artifactId>switchbotapi-java</artifactId>
7-
<version>1.2.2</version>
7+
<version>1.2.3</version>
88

99
<name>switchbotapi-java</name>
1010
<url>https://github.com/bigboxer23/switchbotapi-java</url>
@@ -98,7 +98,7 @@
9898
<threadCount>4</threadCount>
9999
<useUnlimitedThreads>false</useUnlimitedThreads>
100100
<skipITs>${!integration}</skipITs>
101-
<rerunFailingTestsCount>1</rerunFailingTestsCount>
101+
<rerunFailingTestsCount>1</rerunFailingTestsCount>
102102
</configuration>
103103
<executions>
104104
<execution>

src/main/java/com/bigboxer23/switch_bot/SwitchBotApi.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ protected RequestBuilderCallback addAuth() {
6565
builder.addHeader("Authorization", token)
6666
.addHeader("sign", signature)
6767
.addHeader("nonce", nonce)
68-
.addHeader("t", time);
68+
.addHeader("t", time)
69+
.addHeader("Content-Type", "application/json; charset=utf-8");
6970
} catch (NoSuchAlgorithmException | InvalidKeyException e) {
7071
log.warn("exception with auth: ", e);
7172
}

0 commit comments

Comments
 (0)