Echo back the user agent header as a response.
(scope: dict[str, Any], _receive: Receive, send: Send)
| 337 | |
| 338 | |
| 339 | async 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 | |
| 346 | async def get_echo(scope: dict[str, Any], _receive: Receive, send: Send) -> None: |
nothing calls this directly
no test coverage detected