Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/main/java/Diadoc/Api/httpClient/DiadocHttpClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import javax.mail.internet.ParseException;
import java.io.IOException;
import java.net.URISyntaxException;
import java.nio.charset.StandardCharsets;
import java.security.KeyManagementException;
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
Expand Down Expand Up @@ -112,7 +113,7 @@ private byte[] getResponseBytes(HttpResponse response) throws IOException {
if (response.getStatusLine().getStatusCode() != HttpStatus.SC_OK) {
throw new HttpResponseException(
response.getStatusLine().getStatusCode(),
new String(IOUtils.toByteArray(response.getEntity().getContent())));
new String(IOUtils.toByteArray(response.getEntity().getContent()), StandardCharsets.UTF_8));
}
return IOUtils.toByteArray(response.getEntity().getContent());
}
Expand All @@ -121,7 +122,7 @@ private DiadocResponseInfo getResponse(HttpResponse response) throws IOException
if (response.getStatusLine().getStatusCode() != HttpStatus.SC_OK) {
return DiadocResponseInfo.fail(
response.getStatusLine().getStatusCode(),
new String(IOUtils.toByteArray(response.getEntity().getContent())),
new String(IOUtils.toByteArray(response.getEntity().getContent()), StandardCharsets.UTF_8),
tryGetRetryAfter(response));
}
return DiadocResponseInfo.success(IOUtils.toByteArray(response.getEntity().getContent()), response.getStatusLine().getStatusCode());
Expand Down