Skip to content

Commit

Permalink
Fix handling of empty payloads
Browse files Browse the repository at this point in the history
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
  • Loading branch information
mxpv committed Feb 2, 2024
1 parent 336fc1b commit dea99e9
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
3 changes: 0 additions & 3 deletions integration/streaming_test.go
Expand Up @@ -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)
}
Expand Down
2 changes: 1 addition & 1 deletion services.go
Expand Up @@ -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)
}
Expand Down

0 comments on commit dea99e9

Please sign in to comment.