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

Function parse_subprotocol_item

src/websockets/headers.py:426–439  ·  view source on GitHub ↗

Parse a subprotocol from ``header`` at the given position. Return the subprotocol 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

424
425
426def parse_subprotocol_item(
427 header: str, pos: int, header_name: str
428) -> tuple[Subprotocol, int]:
429 """
430 Parse a subprotocol from ``header`` at the given position.
431
432 Return the subprotocol value and the new position.
433
434 Raises:
435 InvalidHeaderFormat: On invalid inputs.
436
437 """
438 item, pos = parse_token(header, pos, header_name)
439 return cast(Subprotocol, item), pos
440
441
442def parse_subprotocol(header: str) -> list[Subprotocol]:

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…