We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2afeb33 commit f51aa84Copy full SHA for f51aa84
test/test_handshake.py
@@ -23,6 +23,17 @@ def test_successful_handshake() -> None:
23
assert repr(server) == "H11Handshake(client=False, state=ConnectionState.OPEN)"
24
25
26
+def test_host_encoding() -> None:
27
+ client = H11Handshake(CLIENT)
28
+ server = H11Handshake(SERVER)
29
+ data = client.send(Request(host="芝士汉堡", target="/"))
30
+ assert b"Host: xn--7ks3rz39bh7u" in data
31
+ server.receive_data(data)
32
+ request = next(server.events())
33
+ assert isinstance(request, Request)
34
+ assert request.host == "芝士汉堡"
35
+
36
37
@pytest.mark.parametrize("http", [b"HTTP/1.0", b"HTTP/1.1"])
38
def test_rejected_handshake(http: bytes) -> None:
39
server = H11Handshake(SERVER)
0 commit comments