Skip to content

Commit 8698c8b

Browse files
authored
Merge pull request #1 from vinscom/migrate-to-binary-support
Added binary support
2 parents b2216f0 + 152cb8d commit 8698c8b

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

src/main/java/in/erail/amazon/lambda/AWSLambda.java

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,7 @@ public JsonObject handleMessage(JsonObject pJsonObject) {
7575

7676
public JsonObject transform(JsonObject pMsg) {
7777

78-
if (!pMsg.containsKey(IS_BASE64_ENCODED)) {
79-
pMsg.put(IS_BASE64_ENCODED, Boolean.FALSE);
80-
}
78+
pMsg.put(IS_BASE64_ENCODED, Boolean.TRUE);
8179

8280
if (!pMsg.containsKey(STATUS_CODE)) {
8381
pMsg.put(STATUS_CODE, "200");
@@ -87,11 +85,10 @@ public JsonObject transform(JsonObject pMsg) {
8785
pMsg.put(HEADERS, new JsonObject());
8886
}
8987

90-
if (!pMsg.containsKey(BODY)) {
91-
pMsg.put(BODY, new JsonObject().toString());
88+
if (pMsg.containsKey(BODY)) {
89+
pMsg.put(BODY, pMsg.getString(BODY));
9290
} else {
93-
String body = pMsg.getValue(BODY).toString();
94-
pMsg.put(BODY, body);
91+
pMsg.put(BODY, "");
9592
}
9693

9794
return pMsg;

0 commit comments

Comments
 (0)