Skip to content

Commit 81b37ba

Browse files
authored
Merge pull request #17 from grove693/base64_json_payload
Add base64 encoding to json payload
2 parents 2421267 + 998619c commit 81b37ba

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
<groupId>dev.inspector</groupId>
66
<artifactId>agent</artifactId>
7-
<version>0.1.6</version>
7+
<version>0.2.0</version>
88

99
<name>agent</name>
1010

src/main/java/dev/inspector/agent/transport/AsyncTransport.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import org.slf4j.Logger;
88
import org.slf4j.LoggerFactory;
99

10+
import java.util.Base64;
1011
import java.util.LinkedList;
1112
import java.util.Queue;
1213
import java.util.concurrent.*;
@@ -52,7 +53,7 @@ public void send(JSONArray items) {
5253
AsyncHttpPost httpHandler = new AsyncHttpPost();
5354
ExecutorService executor = Executors.newFixedThreadPool(10);
5455

55-
String jsonPayload = items.toString();
56+
String jsonPayload = Base64.getUrlEncoder().encodeToString(items.toString().getBytes());
5657

5758
CompletableFuture<String> response = httpHandler.asyncHttpPost(this.conf.getUrl(), jsonPayload, executor, this.conf.getIngestionKey(), this.conf.getVersion());
5859

0 commit comments

Comments
 (0)