(app: ASGIApp)
| 1033 | return await call_next(request) |
| 1034 | |
| 1035 | def replace_body_middleware(app: ASGIApp) -> ASGIApp: |
| 1036 | async def wrapped_app(scope: Scope, receive: Receive, send: Send) -> None: |
| 1037 | async def wrapped_rcv() -> Message: |
| 1038 | msg = await receive() |
| 1039 | msg["body"] += b"-foo" |
| 1040 | return msg |
| 1041 | |
| 1042 | await app(scope, wrapped_rcv, send) |
| 1043 | |
| 1044 | return wrapped_app |
| 1045 | |
| 1046 | async def endpoint(request: Request) -> Response: |
| 1047 | body = await request.body() |
no outgoing calls
no test coverage detected