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)
| 500 | |
| 501 | |
| 502 | def 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 | |
| 518 | def parse_end(header: str, pos: int, header_name: str) -> None: |
no test coverage detected
searching dependent graphs…