Function
wrapped_app
(scope: Scope, receive: Receive, send: Send)
Source from the content-addressed store, hash-verified
| 1001 | |
| 1002 | def modifying_middleware(app: ASGIApp) -> ASGIApp: |
| 1003 | async def wrapped_app(scope: Scope, receive: Receive, send: Send) -> None: |
| 1004 | async def wrapped_receive() -> Message: |
| 1005 | msg = await receive() |
| 1006 | if msg["type"] == "http.request": # pragma: no branch |
| 1007 | msg["body"] = msg["body"] * 2 |
| 1008 | return msg |
| 1009 | |
| 1010 | await app(scope, wrapped_receive, send) |
| 1011 | |
| 1012 | return wrapped_app |
| 1013 | |
Callers
nothing calls this directly
Tested by
no test coverage detected