(ws)
| 48 | |
| 49 | |
| 50 | async def default_handler(ws): |
| 51 | if ws.path == "/deprecated_attributes": |
| 52 | await ws.recv() # delay that allows catching warnings |
| 53 | await ws.send(repr((ws.host, ws.port, ws.secure))) |
| 54 | elif ws.path == "/close_timeout": |
| 55 | await ws.send(repr(ws.close_timeout)) |
| 56 | elif ws.path == "/path": |
| 57 | await ws.send(str(ws.path)) |
| 58 | elif ws.path == "/headers": |
| 59 | await ws.send(repr(ws.request_headers)) |
| 60 | await ws.send(repr(ws.response_headers)) |
| 61 | elif ws.path == "/extensions": |
| 62 | await ws.send(repr(ws.extensions)) |
| 63 | elif ws.path == "/subprotocol": |
| 64 | await ws.send(repr(ws.subprotocol)) |
| 65 | elif ws.path == "/slow_stop": |
| 66 | await ws.wait_closed() |
| 67 | await asyncio.sleep(2 * MS) |
| 68 | else: |
| 69 | await ws.send(await ws.recv()) |
| 70 | |
| 71 | |
| 72 | async def redirect_request(path, headers, test, status): |
nothing calls this directly
no test coverage detected
searching dependent graphs…