frontend: clamp telegram api response to 4096 chars

This commit is contained in:
Lan Tian
2021-03-31 22:43:46 +08:00
parent dc4d7e6532
commit 5b5a09ccbd
3 changed files with 7 additions and 0 deletions

View File

@@ -138,6 +138,10 @@ func webHandlerTelegramBot(w http.ResponseWriter, r *http.Request) {
commandResult = "empty result"
}
if len(commandResult) > 4096 {
commandResult = commandResult[0:4096]
}
// Create a JSON response
w.Header().Add("Content-Type", "application/json")
response := &tgWebhookResponse{