Update json.go

This commit is contained in:
nimrodishi 2024-01-10 11:44:28 +02:00 committed by GitHub
parent 53fbf4dbfb
commit dd85b9721e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -34,6 +34,10 @@ func (jsonBinding) Bind(req *http.Request, obj any) error {
if req == nil || req.Body == nil {
return errors.New("invalid request")
}
body, err := req.GetBody()
if err != nil {
return err
}
return decodeJSON(req.Body, obj)
}