Skip to content

Commit add195b

Browse files
committed
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']`.
1 parent 60168b7 commit add195b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/a2a/server/apps/jsonrpc/jsonrpc_app.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ def build(self, request: Request) -> ServerCallContext:
8989
with contextlib.suppress(Exception):
9090
user = StarletteUserProxy(request.user)
9191
state['auth'] = request.auth
92+
state['headers'] = dict(request.headers)
9293
return ServerCallContext(user=user, state=state)
9394

9495

0 commit comments

Comments
 (0)