Merge pull request #211 from bcmk/close-body

Addressing too many open files error
bot-api-6.1
Kirill Zhuharev 2018-12-14 21:00:14 +03:00 committed by GitHub
commit 9c399358c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

1
bot.go
View File

@ -526,6 +526,7 @@ func (bot *BotAPI) ListenForWebhook(pattern string) UpdatesChannel {
http.HandleFunc(pattern, func(w http.ResponseWriter, r *http.Request) {
bytes, _ := ioutil.ReadAll(r.Body)
r.Body.Close()
var update Update
json.Unmarshal(bytes, &update)