Deprecate --gfe2_reloadable_flag_quic_allow_host_in_request2.
PiperOrigin-RevId: 695948280
diff --git a/quiche/common/quiche_feature_flags_list.h b/quiche/common/quiche_feature_flags_list.h
index 6bbc38d..fab0f08 100755
--- a/quiche/common/quiche_feature_flags_list.h
+++ b/quiche/common/quiche_feature_flags_list.h
@@ -12,7 +12,6 @@
QUICHE_FLAG(bool, quiche_reloadable_flag_quic_act_upon_invalid_header, true, true, "If true, reject or send error response code upon receiving invalid request or response headers.")
QUICHE_FLAG(bool, quiche_reloadable_flag_quic_add_stream_info_to_idle_close_detail, false, true, "If true, include stream information in idle timeout connection close detail.")
QUICHE_FLAG(bool, quiche_reloadable_flag_quic_allow_client_enabled_bbr_v2, true, true, "If true, allow client to enable BBRv2 on server via connection option 'B2ON'.")
-QUICHE_FLAG(bool, quiche_reloadable_flag_quic_allow_host_in_request2, true, true, "If true, requests with a host header will be allowed.")
QUICHE_FLAG(bool, quiche_reloadable_flag_quic_avoid_nested_close_connection, false, true, "If true, if QuicConnection::CloseConnection triggers a nested call to itself, make the nested call a no-op.")
QUICHE_FLAG(bool, quiche_reloadable_flag_quic_bbr2_extra_acked_window, false, true, "When true, the BBR4 copt sets the extra_acked window to 20 RTTs and BBR5 sets it to 40 RTTs.")
QUICHE_FLAG(bool, quiche_reloadable_flag_quic_bbr2_probe_two_rounds, true, true, "When true, the BB2U copt causes BBR2 to wait two rounds with out draining the queue before exiting PROBE_UP and BB2S has the same effect in STARTUP.")
diff --git a/quiche/quic/core/http/quic_spdy_server_stream_base.cc b/quiche/quic/core/http/quic_spdy_server_stream_base.cc
index d010bb5..bfcc565 100644
--- a/quiche/quic/core/http/quic_spdy_server_stream_base.cc
+++ b/quiche/quic/core/http/quic_spdy_server_stream_base.cc
@@ -115,23 +115,20 @@
}
}
- if (GetQuicReloadableFlag(quic_allow_host_in_request2)) {
- // If the :scheme pseudo-header field identifies a scheme that has a
- // mandatory authority component (including "http" and "https"), the
- // request MUST contain either an :authority pseudo-header field or a
- // Host header field. If these fields are present, they MUST NOT be
- // empty. If both fields are present, they MUST contain the same value.
- // If the scheme does not have a mandatory authority component and none
- // is provided in the request target, the request MUST NOT contain the
- // :authority pseudo-header or Host header fields.
- //
- // https://datatracker.ietf.org/doc/html/rfc9114#section-4.3.1
- QUICHE_RELOADABLE_FLAG_COUNT_N(quic_allow_host_in_request2, 2, 3);
- if (host && (!authority || *authority != *host)) {
- QUIC_CODE_COUNT(http3_host_header_does_not_match_authority);
- set_invalid_request_details("Host header does not match authority");
- return false;
- }
+ // If the :scheme pseudo-header field identifies a scheme that has a
+ // mandatory authority component (including "http" and "https"), the
+ // request MUST contain either an :authority pseudo-header field or a
+ // Host header field. If these fields are present, they MUST NOT be
+ // empty. If both fields are present, they MUST contain the same value.
+ // If the scheme does not have a mandatory authority component and none
+ // is provided in the request target, the request MUST NOT contain the
+ // :authority pseudo-header or Host header fields.
+ //
+ // https://datatracker.ietf.org/doc/html/rfc9114#section-4.3.1
+ if (host && (!authority || *authority != *host)) {
+ QUIC_CODE_COUNT(http3_host_header_does_not_match_authority);
+ set_invalid_request_details("Host header does not match authority");
+ return false;
}
if (is_extended_connect) {
diff --git a/quiche/quic/core/http/quic_spdy_server_stream_base_test.cc b/quiche/quic/core/http/quic_spdy_server_stream_base_test.cc
index 2f1c2ff..63719f9 100644
--- a/quiche/quic/core/http/quic_spdy_server_stream_base_test.cc
+++ b/quiche/quic/core/http/quic_spdy_server_stream_base_test.cc
@@ -291,7 +291,6 @@
TEST_F(QuicSpdyServerStreamBaseTest, HostHeaderWithoutAuthority) {
SetQuicReloadableFlag(quic_act_upon_invalid_header, true);
- SetQuicReloadableFlag(quic_allow_host_in_request2, true);
// A request with host but without authority should be rejected.
QuicHeaderList header_list;
header_list.OnHeader("host", "www.google.com:4433");
@@ -311,7 +310,6 @@
TEST_F(QuicSpdyServerStreamBaseTest, HostHeaderWitDifferentAuthority) {
SetQuicReloadableFlag(quic_act_upon_invalid_header, true);
- SetQuicReloadableFlag(quic_allow_host_in_request2, true);
// A request with host that does not match authority should be rejected.
QuicHeaderList header_list;
header_list.OnHeader(":authority", "www.google.com:4433");
@@ -332,7 +330,6 @@
TEST_F(QuicSpdyServerStreamBaseTest, ValidHostHeader) {
SetQuicReloadableFlag(quic_act_upon_invalid_header, true);
- SetQuicReloadableFlag(quic_allow_host_in_request2, true);
// A request with host that matches authority should be accepted.
QuicHeaderList header_list;
header_list.OnHeader(":authority", "www.google.com:4433");
diff --git a/quiche/quic/core/http/quic_spdy_stream.cc b/quiche/quic/core/http/quic_spdy_stream.cc
index 093f4ad..2e649ab 100644
--- a/quiche/quic/core/http/quic_spdy_stream.cc
+++ b/quiche/quic/core/http/quic_spdy_stream.cc
@@ -1777,7 +1777,6 @@
QUIC_DLOG(ERROR) << invalid_request_details_;
return false;
}
- bool is_response = false;
for (const std::pair<std::string, std::string>& pair : header_list) {
const std::string& name = pair.first;
if (!IsValidHeaderName(name)) {
@@ -1786,18 +1785,8 @@
QUIC_DLOG(ERROR) << invalid_request_details_;
return false;
}
- if (name == ":status") {
- is_response = !pair.second.empty();
- }
if (name == "host") {
- if (GetQuicReloadableFlag(quic_allow_host_in_request2)) {
- QUICHE_RELOADABLE_FLAG_COUNT_N(quic_allow_host_in_request2, 1, 3);
- continue;
- }
- if (is_response) {
- // Host header is allowed in response.
- continue;
- }
+ continue;
}
if (http2::GetInvalidHttp2HeaderSet().contains(name)) {
invalid_request_details_ = absl::StrCat(name, " header is not allowed");
diff --git a/quiche/quic/core/http/quic_spdy_stream_test.cc b/quiche/quic/core/http/quic_spdy_stream_test.cc
index 4028098..1ca8721 100644
--- a/quiche/quic/core/http/quic_spdy_stream_test.cc
+++ b/quiche/quic/core/http/quic_spdy_stream_test.cc
@@ -3566,12 +3566,7 @@
Initialize(kShouldProcessData);
headers_["host"] = "foo";
- if (GetQuicReloadableFlag(quic_allow_host_in_request2)) {
- EXPECT_TRUE(stream_->ValidateReceivedHeaders(AsHeaderList(headers_)));
- } else {
- EXPECT_FALSE(stream_->ValidateReceivedHeaders(AsHeaderList(headers_)));
- EXPECT_EQ("host header is not allowed", stream_->invalid_request_details());
- }
+ EXPECT_TRUE(stream_->ValidateReceivedHeaders(AsHeaderList(headers_)));
}
} // namespace