()
| 25 | received = 0 |
| 26 | |
| 27 | async def inner(): |
| 28 | nonlocal received |
| 29 | message = await receive() |
| 30 | if message["type"] != "http.request": |
| 31 | return message # pragma: no cover |
| 32 | |
| 33 | body_len = len(message.get("body", b"")) |
| 34 | received += body_len |
| 35 | assert self.max_content_size is not None |
| 36 | if received > self.max_content_size: |
| 37 | raise HTTPException( |
| 38 | 422, |
| 39 | detail={ |
| 40 | "name": "ContentSizeLimitExceeded", |
| 41 | "code": 999, |
| 42 | "message": "File limit exceeded", |
| 43 | }, |
| 44 | ) |
| 45 | return message |
| 46 | |
| 47 | return inner |
| 48 |
nothing calls this directly
no test coverage detected