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

Function parse_token68

src/websockets/headers.py:502–515  ·  view source on GitHub ↗

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

500
501
502def parse_token68(header: str, pos: int, header_name: str) -> tuple[str, int]:
503 """
504 Parse a token68 from ``header`` at the given position.
505
506 Return the token value and the new position.
507
508 Raises:
509 InvalidHeaderFormat: On invalid inputs.
510
511 """
512 match = _token68_re.match(header, pos)
513 if match is None:
514 raise InvalidHeaderFormat(header_name, "expected token68", header, pos)
515 return match.group(), match.end()
516
517
518def parse_end(header: str, pos: int, header_name: str) -> None:

Callers 1

Calls 1

InvalidHeaderFormatClass · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…