fix: decode empty body (#1882)

pull/1884/head
Tony Chen 3 years ago committed by GitHub
parent 096e2b0d79
commit c550a886e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      transport/http/codec.go

@ -31,6 +31,9 @@ func DefaultRequestDecoder(r *http.Request, v interface{}) error {
if err != nil {
return errors.BadRequest("CODEC", err.Error())
}
if len(data) == 0 {
return nil
}
if err = codec.Unmarshal(data, v); err != nil {
return errors.BadRequest("CODEC", err.Error())
}

Loading…
Cancel
Save