From add195bf1f1dd0409f4416abf6320402c85e9cb8 Mon Sep 17 00:00:00 2001 From: PratikMahajan Date: Wed, 11 Jun 2025 19:38:23 +0000 Subject: [PATCH] feat: Add HTTP headers to ServerCallContext Include HTTP headers in the ServerCallContext to provide handlers with easy access to critical request metadata. This change maintains consistency with the existing design pattern of using the call context for request-specific data and simplifies handler implementation by making headers readily available via `context.state['headers']`. --- src/a2a/server/apps/jsonrpc/jsonrpc_app.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/a2a/server/apps/jsonrpc/jsonrpc_app.py b/src/a2a/server/apps/jsonrpc/jsonrpc_app.py index 71abf25a..ff6998cd 100644 --- a/src/a2a/server/apps/jsonrpc/jsonrpc_app.py +++ b/src/a2a/server/apps/jsonrpc/jsonrpc_app.py @@ -89,6 +89,7 @@ def build(self, request: Request) -> ServerCallContext: with contextlib.suppress(Exception): user = StarletteUserProxy(request.user) state['auth'] = request.auth + state['headers'] = dict(request.headers) return ServerCallContext(user=user, state=state)