MCPcopy
hub / github.com/fastapi/fastapi / inner

Method inner

tests/test_custom_middleware_exception.py:27–45  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

HTTPExceptionClass · 0.90
receiveFunction · 0.70
getMethod · 0.45

Tested by

no test coverage detected