Merge pull request #211 from bcmk/close-body

Addressing too many open files error
pull/216/head
Kirill Zhuharev 7 years ago committed by GitHub
commit 9c399358c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      bot.go

@ -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)