Handshake fails when the Upgrade header is invalid.
(self)
| 386 | ) |
| 387 | |
| 388 | def test_invalid_upgrade(self): |
| 389 | """Handshake fails when the Upgrade header is invalid.""" |
| 390 | client = ClientProtocol(URI) |
| 391 | with alter_and_receive_response(client) as response: |
| 392 | del response.headers["Upgrade"] |
| 393 | response.headers["Upgrade"] = "h2c" |
| 394 | |
| 395 | self.assertHandshakeError( |
| 396 | client, |
| 397 | InvalidHeader, |
| 398 | "invalid Upgrade header: h2c", |
| 399 | ) |
| 400 | |
| 401 | def test_missing_accept(self): |
| 402 | """Handshake fails when the Sec-WebSocket-Accept header is missing.""" |
nothing calls this directly
no test coverage detected