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

Method __call__

examples/multidomainapp.py:13–22  ·  view source on GitHub ↗
(self, environ, start_response)

Source from the content-addressed store, hash-verified

11 self.mapping = mapping
12
13 def __call__(self, environ, start_response):
14 host = environ.get("HTTP_HOST", "")
15 host = host.split(":")[0] # strip port
16
17 for pattern, app in self.mapping:
18 if re.match("^" + pattern + "$", host):
19 return app(environ, start_response)
20 else:
21 start_response("404 Not Found", [])
22 return [b""]
23
24def hello(environ, start_response):
25 start_response("200 OK", [("Content-Type", "text/plain")])

Callers

nothing calls this directly

Calls 2

appFunction · 0.70
getMethod · 0.45

Tested by

no test coverage detected