Write correct request body byte length (#2)

Fixes #1, an HTTP 400 Bad Request error caused by a byte length mismatch.
This commit is contained in:
Haneki 2023-07-29 02:04:05 +08:00 committed by GitHub
parent 889220837c
commit fae5d5f705
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -45,7 +45,7 @@ public class MatterbridgeApiClient {
try (OutputStream outputStream = connection.getOutputStream()) {
byte[] requestBodyBytes = requestBody.getBytes(StandardCharsets.UTF_8);
outputStream.write(requestBodyBytes, 0, requestBody.length());
outputStream.write(requestBodyBytes, 0, requestBodyBytes.length);
}
if (connection.getResponseCode() >= 400) {