MCPcopy Index your code
hub / github.com/google/adk-python / _get_scope_header

Function _get_scope_header

src/google/adk/cli/api_server.py:158–165  ·  view source on GitHub ↗

Return the first matching header value from an ASGI scope.

(
    scope: dict[str, Any], header_name: bytes
)

Source from the content-addressed store, hash-verified

156
157
158def _get_scope_header(
159 scope: dict[str, Any], header_name: bytes
160) -> Optional[str]:
161 """Return the first matching header value from an ASGI scope."""
162 for candidate_name, candidate_value in scope.get("headers", []):
163 if candidate_name == header_name:
164 return candidate_value.decode("latin-1").split(",", 1)[0].strip()
165 return None
166
167
168def _get_request_origin(scope: dict[str, Any]) -> Optional[str]:

Callers 2

_get_request_originFunction · 0.85
__call__Method · 0.85

Calls 3

stripMethod · 0.80
splitMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected