Parse a ``Sec-WebSocket-Protocol`` header. Return a list of WebSocket subprotocols. Raises: InvalidHeaderFormat: On invalid inputs.
(header: str)
| 440 | |
| 441 | |
| 442 | def parse_subprotocol(header: str) -> list[Subprotocol]: |
| 443 | """ |
| 444 | Parse a ``Sec-WebSocket-Protocol`` header. |
| 445 | |
| 446 | Return a list of WebSocket subprotocols. |
| 447 | |
| 448 | Raises: |
| 449 | InvalidHeaderFormat: On invalid inputs. |
| 450 | |
| 451 | """ |
| 452 | return parse_list(parse_subprotocol_item, header, 0, "Sec-WebSocket-Protocol") |
| 453 | |
| 454 | |
| 455 | parse_subprotocol_list = parse_subprotocol # alias for backwards compatibility |
searching dependent graphs…