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

Method _build_http2_environ

gunicorn/asgi/protocol.py:1775–1790  ·  view source on GitHub ↗

Build minimal environ dict for access logging.

(self, request, sockname, peername)

Source from the content-addressed store, hash-verified

1773 return scope
1774
1775 def _build_http2_environ(self, request, sockname, peername):
1776 """Build minimal environ dict for access logging."""
1777 environ = {
1778 "REQUEST_METHOD": request.method,
1779 "RAW_URI": request.uri,
1780 "PATH_INFO": request.path,
1781 "QUERY_STRING": request.query or "",
1782 "SERVER_PROTOCOL": "HTTP/2",
1783 "REMOTE_ADDR": peername[0] if peername else "-",
1784 }
1785
1786 for name, value in request.headers:
1787 key = "HTTP_" + name.replace("-", "_")
1788 environ[key] = value
1789
1790 return environ

Callers 1

_handle_http2_requestMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected