Skip to content

Commit

Permalink
Fix Webhook mode unable to process received data
Browse files Browse the repository at this point in the history
  • Loading branch information
huanmeng-qwq committed Nov 6, 2023
1 parent b0c0be1 commit 6066048
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,20 +56,19 @@ public void handle(Request<JsonObject> request) {
request.reply(400, "");
return;
}
// challenge part
if (has(frame.getData(), "channel_type")) {
final String channelType = get(frame.getData(), "channel_type").getAsString();
if ("WEBHOOK_CHALLENGE".equals(channelType)) {
// challenge part
String challengeValue = frame.getData().get("challenge").getAsString();
JsonObject obj = new JsonObject();
obj.addProperty("challenge", challengeValue);
String challengeJson = NORMAL_GSON.toJson(obj);
request.reply(200, challengeJson);
return;
// end challenge part
}
}
// end challenge part
else {
handler.handle(frame);
}
handler.handle(frame);
}
}

0 comments on commit 6066048

Please sign in to comment.