Fix handling of empty payloads

Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
This commit is contained in:
Maksym Pavlenko 2024-02-02 12:10:01 -08:00
parent 336fc1b6b4
commit dea99e9d05
2 changed files with 1 additions and 4 deletions

View File

@ -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 {
t.Fatalf("Expected io.EOF, got %v", err)
}

View File

@ -140,7 +140,7 @@ func (s *serviceSet) handle(ctx context.Context, req *Request, respond func(*sta
respond(st, p, stream.StreamingServer, true)
}()
if req.Payload != nil {
if req.Payload != nil || !info.StreamingClient {
unmarshal := func(obj interface{}) error {
return protoUnmarshal(req.Payload, obj)
}