Closing update body

bot-api-6.1
bcmk 2018-12-10 18:02:58 +04:00
parent 9860bdfd3a
commit ab8d5487da
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) { http.HandleFunc(pattern, func(w http.ResponseWriter, r *http.Request) {
bytes, _ := ioutil.ReadAll(r.Body) bytes, _ := ioutil.ReadAll(r.Body)
r.Body.Close()
var update Update var update Update
json.Unmarshal(bytes, &update) json.Unmarshal(bytes, &update)