MCPcopy Index your code
hub / github.com/python-websockets/websockets / parse_connection_option

Function parse_connection_option

src/websockets/headers.py:231–244  ·  view source on GitHub ↗

Parse a Connection option from ``header`` at the given position. Return the protocol value and the new position. Raises: InvalidHeaderFormat: On invalid inputs.

(
    header: str, pos: int, header_name: str
)

Source from the content-addressed store, hash-verified

229
230
231def parse_connection_option(
232 header: str, pos: int, header_name: str
233) -> tuple[ConnectionOption, int]:
234 """
235 Parse a Connection option from ``header`` at the given position.
236
237 Return the protocol value and the new position.
238
239 Raises:
240 InvalidHeaderFormat: On invalid inputs.
241
242 """
243 item, pos = parse_token(header, pos, header_name)
244 return cast(ConnectionOption, item), pos
245
246
247def parse_connection(header: str) -> list[ConnectionOption]:

Callers

nothing calls this directly

Calls 1

parse_tokenFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…