diff --git a/transport/http/codec.go b/transport/http/codec.go index ff734ba15..adca51675 100644 --- a/transport/http/codec.go +++ b/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()) }