Handle requests with a configurable delay to test timeouts.
(scope: dict[str, Any], _receive: Receive, send: Send)
| 431 | |
| 432 | |
| 433 | async def slow_response(scope: dict[str, Any], _receive: Receive, send: Send) -> None: |
| 434 | """Handle requests with a configurable delay to test timeouts.""" |
| 435 | query_params = get_query_params(scope.get('query_string', b'')) |
| 436 | delay = float(query_params.get('delay', '5')) # Default 5 second delay |
| 437 | |
| 438 | await asyncio.sleep(delay) |
| 439 | await send_html_response(send, HELLO_WORLD) |
| 440 | |
| 441 | |
| 442 | async def infinite_scroll_endpoint(_scope: dict[str, Any], _receive: Receive, send: Send) -> None: |
nothing calls this directly
no test coverage detected