MCPcopy
hub / github.com/benoitc/gunicorn / parse

Method parse

gunicorn/asgi/uwsgi.py:65–85  ·  view source on GitHub ↗

Parse a uWSGI request asynchronously. Args: cfg: gunicorn config object unreader: AsyncUnreader instance peer_addr: client address tuple req_number: request number on this connection (for keepalive) Returns: AsyncUWSGIRequ

(cls, cfg, unreader, peer_addr, req_number=1)

Source from the content-addressed store, hash-verified

63 # pylint: disable=arguments-differ,invalid-overridden-method
64 @classmethod
65 async def parse(cls, cfg, unreader, peer_addr, req_number=1):
66 """Parse a uWSGI request asynchronously.
67
68 Args:
69 cfg: gunicorn config object
70 unreader: AsyncUnreader instance
71 peer_addr: client address tuple
72 req_number: request number on this connection (for keepalive)
73
74 Returns:
75 AsyncUWSGIRequest: Parsed request object
76
77 Raises:
78 InvalidUWSGIHeader: If the uWSGI header is malformed
79 UnsupportedModifier: If modifier1 is not 0
80 ForbiddenUWSGIRequest: If source IP is not allowed
81 """
82 req = cls(cfg, unreader, peer_addr, req_number)
83 req._check_allowed_ip() # Reuse from parent
84 await req._async_parse()
85 return req
86
87 async def _async_parse(self):
88 """Async version of parse() - reads data then uses sync parsing."""

Callers 1

Calls 2

_check_allowed_ipMethod · 0.80
_async_parseMethod · 0.80

Tested by

no test coverage detected