Verifies all invariant- and required headers If a header is missing or have an incorrect value ValueError will be raised
(self, handler: WebSocketHandler)
| 897 | return |
| 898 | |
| 899 | def _handle_websocket_headers(self, handler: WebSocketHandler) -> None: |
| 900 | """Verifies all invariant- and required headers |
| 901 | |
| 902 | If a header is missing or have an incorrect value ValueError will be |
| 903 | raised |
| 904 | """ |
| 905 | fields = ("Host", "Sec-Websocket-Key", "Sec-Websocket-Version") |
| 906 | if not all(map(lambda f: handler.request.headers.get(f), fields)): |
| 907 | raise ValueError("Missing/Invalid WebSocket headers") |
| 908 | |
| 909 | @staticmethod |
| 910 | def compute_accept_value(key: Union[str, bytes]) -> str: |
no test coverage detected