MCPcopy Create free account
hub / github.com/apify/crawlee-python / echo_user_agent

Function echo_user_agent

tests/unit/server.py:339–343  ·  view source on GitHub ↗

Echo back the user agent header as a response.

(scope: dict[str, Any], _receive: Receive, send: Send)

Source from the content-addressed store, hash-verified

337
338
339async def echo_user_agent(scope: dict[str, Any], _receive: Receive, send: Send) -> None:
340 """Echo back the user agent header as a response."""
341 headers = get_headers_dict(scope)
342 user_agent = headers.get('user-agent', 'Not provided')
343 await send_json_response(send, {'user-agent': user_agent})
344
345
346async def get_echo(scope: dict[str, Any], _receive: Receive, send: Send) -> None:

Callers

nothing calls this directly

Calls 2

get_headers_dictFunction · 0.85
send_json_responseFunction · 0.85

Tested by

no test coverage detected