Skip to content
This repository was archived by the owner on Mar 31, 2021. It is now read-only.

Commit 1f463f5

Browse files
authored
Bug Fix, change the request body encoding to UTF-8 (#68)
1 parent 47f4b3e commit 1f463f5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/java/com/amazon/opendistroforelasticsearch/jdbc/transport/http/ApacheHttpTransport.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
import org.apache.http.conn.ssl.NoopHostnameVerifier;
4343
import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
4444
import org.apache.http.conn.ssl.TrustSelfSignedStrategy;
45+
import org.apache.http.entity.ContentType;
4546
import org.apache.http.entity.StringEntity;
4647
import org.apache.http.impl.client.BasicCredentialsProvider;
4748
import org.apache.http.impl.client.CloseableHttpClient;
@@ -259,7 +260,7 @@ private CloseableHttpResponse doPost(URI uri, Header[] headers, String body, int
259260
setReadTimeout(readTimeout);
260261
HttpPost request = new HttpPost(uri);
261262
request.setHeaders(headers);
262-
request.setEntity(new StringEntity(body));
263+
request.setEntity(new StringEntity(body, ContentType.APPLICATION_JSON));
263264
request.setConfig(getRequestConfig());
264265
return httpClient.execute(request);
265266
} catch (IOException e) {

0 commit comments

Comments
 (0)