diff --git a/examples/examplepb/flow_combination.pb.gw.go b/examples/examplepb/flow_combination.pb.gw.go index e6569a963b5..2845b8dbdbc 100644 --- a/examples/examplepb/flow_combination.pb.gw.go +++ b/examples/examplepb/flow_combination.pb.gw.go @@ -105,6 +105,9 @@ func request_FlowCombination_StreamEmptyStream_0(ctx context.Context, marshaler handleSend := func() error { var protoReq EmptyProto err = dec.Decode(&protoReq) + if err == io.EOF { + return err + } if err != nil { grpclog.Printf("Failed to decode request: %v", err) return err diff --git a/examples/examplepb/stream.pb.gw.go b/examples/examplepb/stream.pb.gw.go index f0baafe8f4d..ae24644cadf 100644 --- a/examples/examplepb/stream.pb.gw.go +++ b/examples/examplepb/stream.pb.gw.go @@ -98,6 +98,9 @@ func request_StreamService_BulkEcho_0(ctx context.Context, marshaler runtime.Mar handleSend := func() error { var protoReq sub.StringMessage err = dec.Decode(&protoReq) + if err == io.EOF { + return err + } if err != nil { grpclog.Printf("Failed to decode request: %v", err) return err diff --git a/protoc-gen-grpc-gateway/gengateway/template.go b/protoc-gen-grpc-gateway/gengateway/template.go index 5b760220210..a5781dd7689 100644 --- a/protoc-gen-grpc-gateway/gengateway/template.go +++ b/protoc-gen-grpc-gateway/gengateway/template.go @@ -248,6 +248,9 @@ var ( handleSend := func() error { var protoReq {{.Method.RequestType.GoType .Method.Service.File.GoPkg.Path}} err = dec.Decode(&protoReq) + if err == io.EOF { + return err + } if err != nil { grpclog.Printf("Failed to decode request: %v", err) return err