Handshake fails when checking origin and the Origin header is missing.
(self)
| 548 | self.assertEqual(server.origin, "https://example.com") |
| 549 | |
| 550 | def test_no_origin(self): |
| 551 | """Handshake fails when checking origin and the Origin header is missing.""" |
| 552 | server = ServerProtocol(origins=["https://example.com"]) |
| 553 | request = make_request() |
| 554 | response = server.accept(request) |
| 555 | server.send_response(response) |
| 556 | |
| 557 | self.assertEqual(response.status_code, 403) |
| 558 | self.assertHandshakeError( |
| 559 | server, |
| 560 | InvalidOrigin, |
| 561 | "missing Origin header", |
| 562 | ) |
| 563 | |
| 564 | def test_unexpected_origin(self): |
| 565 | """Handshake fails when checking origin and the Origin header is unexpected.""" |
nothing calls this directly
no test coverage detected