MCPcopy
hub / github.com/pallets/werkzeug / _get_server

Function _get_server

src/werkzeug/wsgi.py:69–83  ·  view source on GitHub ↗
(
    environ: WSGIEnvironment,
)

Source from the content-addressed store, hash-verified

67
68
69def _get_server(
70 environ: WSGIEnvironment,
71) -> tuple[str, int | None] | None:
72 name = environ.get("SERVER_NAME")
73
74 if name is None:
75 return None
76
77 try:
78 port: int | None = int(environ.get("SERVER_PORT", None)) # type: ignore[arg-type]
79 except (TypeError, ValueError):
80 # unix socket
81 port = None
82
83 return name, port
84
85
86def get_host(

Callers 2

get_hostFunction · 0.85
__init__Method · 0.85

Calls 1

getMethod · 0.45

Tested by

no test coverage detected