From 516384aec7f3fb01360fcd7db5a7634a2b99631e Mon Sep 17 00:00:00 2001 From: bashi Date: Wed, 17 Nov 2021 18:30:34 +0900 Subject: [PATCH] [webtransport] Set ENABLE_CONNECT_PROTOCOL settings flag (#31573) This is required to use an Extended CONNECT method. WebTransport uses an Extended CONNECT method. --- tools/webtransport/h3/webtransport_h3_server.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/webtransport/h3/webtransport_h3_server.py b/tools/webtransport/h3/webtransport_h3_server.py index 37c496db4b607d9..7fd30f2b1b3e700 100644 --- a/tools/webtransport/h3/webtransport_h3_server.py +++ b/tools/webtransport/h3/webtransport_h3_server.py @@ -42,6 +42,8 @@ class H3ConnectionWithDatagram04(H3Connection): HTTP Datagram protocol. """ H3_DATAGRAM_04 = 0xffd277 + # https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-h3-websockets-00#section-5 + ENABLE_CONNECT_PROTOCOL = 0x08 def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -58,6 +60,7 @@ def _get_local_settings(self) -> Dict[int, int]: H3_DATAGRAM_04 = H3ConnectionWithDatagram04.H3_DATAGRAM_04 settings = super()._get_local_settings() settings[H3_DATAGRAM_04] = 1 + settings[H3ConnectionWithDatagram04.ENABLE_CONNECT_PROTOCOL] = 1 return settings @property