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

Method _convert_h2_headers

gunicorn/asgi/protocol.py:1537–1546  ·  view source on GitHub ↗

Convert ASGI headers to HTTP/2 format (lowercase string names).

(self, headers)

Source from the content-addressed store, hash-verified

1535 self._close_transport()
1536
1537 def _convert_h2_headers(self, headers):
1538 """Convert ASGI headers to HTTP/2 format (lowercase string names)."""
1539 result = []
1540 for name, value in headers:
1541 if isinstance(name, bytes):
1542 name = name.decode("latin-1")
1543 if isinstance(value, bytes):
1544 value = value.decode("latin-1")
1545 result.append((name.lower(), value))
1546 return result
1547
1548 async def _handle_http2_request(self, request, h2_conn, sockname, peername):
1549 """Handle a single HTTP/2 request with streaming support.

Callers 2

sendMethod · 0.95
_handle_http2_requestMethod · 0.95

Calls 1

decodeMethod · 0.80

Tested by

no test coverage detected