fix uninitialized response metadata for incoming context (#264)
All checks were successful
coverage / build (push) Has been skipped
test / test (push) Successful in 2m8s
sync / sync (push) Successful in 18s

This commit is contained in:
2025-05-01 22:42:59 +05:00
committed by GitHub
parent 6d8fce53dd
commit 934ebf6c0a

View File

@@ -263,7 +263,7 @@ func (g *Server) handler(srv interface{}, stream grpc.ServerStream) error {
// create new context // create new context
ctx = metadata.NewIncomingContext(ctx, md) ctx = metadata.NewIncomingContext(ctx, md)
ctx = metadata.NewOutgoingContext(ctx, metadata.New(0)) ctx = metadata.NewOutgoingContext(ctx, metadata.New(0))
ctx = context.WithValue(ctx, rspMetadataKey{}, &rspMetadataVal{}) ctx = context.WithValue(ctx, rspMetadataKey{}, &rspMetadataVal{m: metadata.New(0)})
stream = &streamWrapper{ctx, stream} stream = &streamWrapper{ctx, stream}