Skip to content

Commit dea99e9

Browse files
committed
Fix handling of empty payloads
Signed-off-by: Maksym Pavlenko <[email protected]>
1 parent 336fc1b commit dea99e9

2 files changed

Lines changed: 1 addition & 4 deletions

File tree

integration/streaming_test.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -420,9 +420,6 @@ func emptyPayloadStream(ctx context.Context, client streaming.TTRPCStreamingClie
420420
}
421421
}
422422

423-
if err := stream.CloseSend(); err != nil {
424-
t.Fatal(err)
425-
}
426423
if _, err := stream.Recv(); err != io.EOF {
427424
t.Fatalf("Expected io.EOF, got %v", err)
428425
}

services.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ func (s *serviceSet) handle(ctx context.Context, req *Request, respond func(*sta
140140
respond(st, p, stream.StreamingServer, true)
141141
}()
142142

143-
if req.Payload != nil {
143+
if req.Payload != nil || !info.StreamingClient {
144144
unmarshal := func(obj interface{}) error {
145145
return protoUnmarshal(req.Payload, obj)
146146
}

0 commit comments

Comments
 (0)