Added stream processing of input JSON
Co-authored-by: TJ Horner <me@tjhorner.com>bot-api-6.1
parent
20b57111fc
commit
b6575a2934
11
bot.go
11
bot.go
|
@ -579,17 +579,8 @@ func (bot *BotAPI) HandleUpdate(r *http.Request) (*Update, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
payload, err := ioutil.ReadAll(r.Body)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if err := r.Body.Close(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var update Update
|
||||
err = json.Unmarshal(payload, &update)
|
||||
err := json.NewDecoder(r.Body).Decode(&update)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue