connect-ip and connect-udp: percent encode * to %2A Implement the fix for this errata: https://errata.rfc-editor.org/eid8444/ And the corresponding spec change that went into connect-udp-bind Also remove the connect-ip-version header leftover from before RFC publication PiperOrigin-RevId: 1019616444
diff --git a/quiche/quic/masque/masque_client_session.cc b/quiche/quic/masque/masque_client_session.cc index 5eea086..20272dc 100644 --- a/quiche/quic/masque/masque_client_session.cc +++ b/quiche/quic/masque/masque_client_session.cc
@@ -114,8 +114,8 @@ std::string target_host, target_port; if (IsBind()) { - target_host = "*"; - target_port = "*"; + target_host = "%2A"; + target_port = "%2A"; } else { auto it = fake_addresses_.find(target_server_address.host().ToPackedString()); @@ -252,7 +252,7 @@ QuicUrl url(uri_template_); std::string scheme = url.scheme(); std::string authority = url.HostPort(); - std::string path = "/.well-known/masque/ip/*/*/"; + std::string path = "/.well-known/masque/ip/%2A/%2A/"; QUIC_DLOG(INFO) << "Sending CONNECT-IP request on stream " << stream->id() << " scheme=\"" << scheme << "\" authority=\"" << authority @@ -265,7 +265,6 @@ headers[":scheme"] = scheme; headers[":authority"] = authority; headers[":path"] = path; - headers["connect-ip-version"] = "3"; AddAdditionalHeaders(headers, url); QUIC_DVLOG(1) << "Sending request headers: " << headers.DebugString(); size_t bytes_sent =
diff --git a/quiche/quic/masque/masque_server_session.cc b/quiche/quic/masque/masque_server_session.cc index cf41c36..5094f47 100644 --- a/quiche/quic/masque/masque_server_session.cc +++ b/quiche/quic/masque/masque_server_session.cc
@@ -598,7 +598,7 @@ } QuicSocketAddress target_server_address; - if (has_bind_header && host == "*" && port == "*") { + if (has_bind_header && host == "%2A" && port == "%2A") { // This is a valid connect-udp-bind request. target_server_address = QuicSocketAddress(); } else if (has_bind_header) { @@ -610,7 +610,7 @@ absl::StrCat( "Bad value for target when connect-udp-bind is present: host:", host.value(), " port: ", port.value())); - } else if (host == "*" || port == "*") { + } else if (host == "%2A" || port == "%2A") { // Error. QUIC_DLOG(ERROR) << "Bad value for target when connect-udp-bind is absent: host:"