From 5dcd73a453351e0f9bac417fec060fa4ada8fe33 Mon Sep 17 00:00:00 2001 From: Lidi Zheng Date: Fri, 1 Apr 2022 15:17:30 -0700 Subject: [PATCH] [PSM interp] Set hostname in initial metdata for Python servers --- .../grpcio_tests/tests_py3_only/interop/xds_interop_server.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/python/grpcio_tests/tests_py3_only/interop/xds_interop_server.py b/src/python/grpcio_tests/tests_py3_only/interop/xds_interop_server.py index 2c44b42e2ec..0a46eefb533 100644 --- a/src/python/grpcio_tests/tests_py3_only/interop/xds_interop_server.py +++ b/src/python/grpcio_tests/tests_py3_only/interop/xds_interop_server.py @@ -59,10 +59,12 @@ class TestService(test_pb2_grpc.TestServiceServicer): def EmptyCall(self, _: empty_pb2.Empty, context: grpc.ServicerContext) -> empty_pb2.Empty: + context.send_initial_metadata(('hostname', self._hostname)) return empty_pb2.Empty() def UnaryCall(self, request: messages_pb2.SimpleRequest, context: grpc.ServicerContext) -> messages_pb2.SimpleResponse: + context.send_initial_metadata(('hostname', self._hostname)) response = messages_pb2.SimpleResponse() response.server_id = self._server_id response.hostname = self._hostname