diff --git a/transport/http/codec.go b/transport/http/codec.go index ef00ea6e9..bda318398 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()) }