Skip to content

Commit

Permalink
Fix Charset encoding on Outbound
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephen Fox committed Nov 22, 2023
1 parent d8771ab commit b7bdacf
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ and minimize the interactions with the ConnId framework and have much of that
taken care of by a common API.

# Change Log
+ **4.1.8** - Fix Charset on outbound to specify UTF-8 charset
+ **4.1.7** - FIN-11103 - Support multiple PEM content types (11/06/2023)
+ **4.1.6** - FIN-11103 - Private Key and PEM changed to guarded string (11/02/2023)
+ **4.1.5** - FIN-11103 - Private Key and PEM support for ADP (11/01/2023)
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
software_version=4.1.7
software_version=4.1.8
test_connector_version=3.0.1

Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@
import com.google.gson.GsonBuilder;
import com.google.gson.JsonSyntaxException;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.InetSocketAddress;
import java.net.URI;
import java.nio.charset.StandardCharsets;
import java.util.Map;
import org.apache.commons.codec.Charsets;
import org.apache.commons.lang3.StringUtils;
Expand All @@ -50,8 +50,8 @@
import org.apache.http.config.RegistryBuilder;
import org.apache.http.conn.socket.ConnectionSocketFactory;
import org.apache.http.conn.socket.PlainConnectionSocketFactory;
import org.apache.http.entity.ByteArrayEntity;
import org.apache.http.entity.ContentType;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.BasicCredentialsProvider;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.impl.client.HttpClients;
Expand Down Expand Up @@ -636,8 +636,8 @@ protected void setupJsonRequestBody(
}

try {
request.setEntity(new StringEntity(bodyData));
} catch (UnsupportedEncodingException e) {
request.setEntity(new ByteArrayEntity(bodyData.getBytes(StandardCharsets.UTF_8)));
} catch (Exception e) {
throw new ConnectorException("Request body encoding failed for data: " + bodyData, e);
}
}
Expand Down

0 comments on commit b7bdacf

Please sign in to comment.