Fix handling of empty payloads
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
This commit is contained in:
@@ -420,9 +420,6 @@ func emptyPayloadStream(ctx context.Context, client streaming.TTRPCStreamingClie
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := stream.CloseSend(); err != nil {
|
|
||||||
t.Fatal(err)
|
|
||||||
}
|
|
||||||
if _, err := stream.Recv(); err != io.EOF {
|
if _, err := stream.Recv(); err != io.EOF {
|
||||||
t.Fatalf("Expected io.EOF, got %v", err)
|
t.Fatalf("Expected io.EOF, got %v", err)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -140,7 +140,7 @@ func (s *serviceSet) handle(ctx context.Context, req *Request, respond func(*sta
|
|||||||
respond(st, p, stream.StreamingServer, true)
|
respond(st, p, stream.StreamingServer, true)
|
||||||
}()
|
}()
|
||||||
|
|
||||||
if req.Payload != nil {
|
if req.Payload != nil || !info.StreamingClient {
|
||||||
unmarshal := func(obj interface{}) error {
|
unmarshal := func(obj interface{}) error {
|
||||||
return protoUnmarshal(req.Payload, obj)
|
return protoUnmarshal(req.Payload, obj)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user