Allow all 2xx codes in WebTransport instead of just 200.
This is per <https://github.com/ietf-wg-webtrans/draft-ietf-webtrans-http3/issues/42>; since this is backwards compatible, this is not gated on the WebTransport version.
PiperOrigin-RevId: 392771392
diff --git a/quic/core/http/web_transport_http3.cc b/quic/core/http/web_transport_http3.cc
index 820950b..771e3fa 100644
--- a/quic/core/http/web_transport_http3.cc
+++ b/quic/core/http/web_transport_http3.cc
@@ -85,11 +85,19 @@
void WebTransportHttp3::HeadersReceived(const spdy::SpdyHeaderBlock& headers) {
if (session_->perspective() == Perspective::IS_CLIENT) {
- auto it = headers.find(":status");
- if (it == headers.end() || it->second != "200") {
+ int status_code;
+ if (!QuicSpdyStream::ParseHeaderStatusCode(headers, &status_code)) {
QUIC_DVLOG(1) << ENDPOINT
<< "Received WebTransport headers from server without "
- "status 200, rejecting.";
+ "a valid status code, rejecting.";
+ return;
+ }
+ bool valid_status = status_code >= 200 && status_code <= 299;
+ if (!valid_status) {
+ QUIC_DVLOG(1) << ENDPOINT
+ << "Received WebTransport headers from server with "
+ "status code "
+ << status_code << ", rejecting.";
return;
}
}