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

Method __init__

gunicorn/uwsgi/message.py:31–68  ·  view source on GitHub ↗
(self, cfg, unreader, peer_addr, req_number=1)

Source from the content-addressed store, hash-verified

29 """
30
31 def __init__(self, cfg, unreader, peer_addr, req_number=1):
32 self.cfg = cfg
33 self.unreader = unreader
34 self.peer_addr = peer_addr
35 self.remote_addr = peer_addr
36 self.req_number = req_number
37
38 # Request attributes (compatible with HTTP Request interface)
39 self.method = None
40 self.uri = None
41 self.path = None
42 self.query = None
43 self.fragment = ""
44 self.version = (1, 1) # uWSGI is HTTP/1.1 compatible
45 self.headers = []
46 self.trailers = []
47 self.body = None
48 self.scheme = "https" if cfg.is_ssl else "http"
49 self.must_close = False
50
51 # uWSGI specific
52 self.uwsgi_vars = {}
53 self.modifier1 = 0
54 self.modifier2 = 0
55
56 # Proxy protocol compatibility
57 self.proxy_protocol_info = None
58
59 # 100-continue: not applicable for uWSGI as the frontend handles this
60 self._expected_100_continue = False
61
62 # Check if the source IP is allowed
63 self._check_allowed_ip()
64
65 # Parse the request
66 unused = self.parse(self.unreader)
67 self.unreader.unread(unused)
68 self.set_body_reader()
69
70 def _check_allowed_ip(self):
71 """Verify source IP is in the allowed list."""

Callers

nothing calls this directly

Calls 4

_check_allowed_ipMethod · 0.95
parseMethod · 0.95
set_body_readerMethod · 0.95
unreadMethod · 0.45

Tested by

no test coverage detected