Closing update body

This commit is contained in:
bcmk 2018-12-10 18:02:58 +04:00
parent 9860bdfd3a
commit ab8d5487da

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)