@@ -1551,6 +1551,90 @@ TEST_P(ProtocolIntegrationTest, EnvoyProxying104) {
1551
1551
testEnvoyProxying1xx (false , false , false , " 104" );
1552
1552
}
1553
1553
1554
+ TEST_P (DownstreamProtocolIntegrationTest, EnvoyProxying102DelayBalsaReset) {
1555
+ if (GetParam ().http1_implementation != Http1ParserImpl::BalsaParser ||
1556
+ GetParam ().upstream_protocol != Http::CodecType::HTTP1 ||
1557
+ GetParam ().downstream_protocol != Http::CodecType::HTTP1) {
1558
+ GTEST_SKIP () << " This test is only relevant for HTTP1 BalsaParser" ;
1559
+ }
1560
+ config_helper_.addConfigModifier (
1561
+ [&](envoy::extensions::filters::network::http_connection_manager::v3::HttpConnectionManager&
1562
+ hcm) -> void { hcm.set_proxy_100_continue (true ); });
1563
+ config_helper_.addRuntimeOverride (
1564
+ " envoy.reloadable_features.wait_for_first_byte_before_balsa_msg_done" , " false" );
1565
+ config_helper_.addRuntimeOverride (" envoy.reloadable_features.http1_balsa_delay_reset" , " true" );
1566
+ initialize ();
1567
+
1568
+ codec_client_ = makeHttpConnection (lookupPort (" http" ));
1569
+ auto response = codec_client_->makeHeaderOnlyRequest (
1570
+ Http::TestRequestHeaderMapImpl{{" :method" , " HEAD" },
1571
+ {" :path" , " /dynamo/url" },
1572
+ {" :scheme" , " http" },
1573
+ {" :authority" , " sni.lyft.com" },
1574
+ {" expect" , " 100-contINUE" }});
1575
+ waitForNextUpstreamRequest ();
1576
+ upstream_request_->encode1xxHeaders (Http::TestResponseHeaderMapImpl{{" :status" , " 102" }});
1577
+ response->waitFor1xxHeaders ();
1578
+ upstream_request_->encodeHeaders (default_response_headers_, true );
1579
+
1580
+ EXPECT_FALSE (response->waitForEndStream ());
1581
+
1582
+ cleanupUpstreamAndDownstream ();
1583
+ }
1584
+
1585
+ TEST_P (DownstreamProtocolIntegrationTest, EnvoyProxying102DelayBalsaResetWaitForFirstByte) {
1586
+ if (GetParam ().http1_implementation != Http1ParserImpl::BalsaParser ||
1587
+ GetParam ().upstream_protocol != Http::CodecType::HTTP1) {
1588
+ GTEST_SKIP () << " This test is only relevant for HTTP1 upstream with BalsaParser" ;
1589
+ }
1590
+ config_helper_.addConfigModifier (
1591
+ [&](envoy::extensions::filters::network::http_connection_manager::v3::HttpConnectionManager&
1592
+ hcm) -> void { hcm.set_proxy_100_continue (true ); });
1593
+ config_helper_.addRuntimeOverride (
1594
+ " envoy.reloadable_features.wait_for_first_byte_before_balsa_msg_done" , " true" );
1595
+ config_helper_.addRuntimeOverride (" envoy.reloadable_features.http1_balsa_delay_reset" , " true" );
1596
+ initialize ();
1597
+
1598
+ codec_client_ = makeHttpConnection (lookupPort (" http" ));
1599
+ auto response = codec_client_->makeHeaderOnlyRequest (
1600
+ Http::TestRequestHeaderMapImpl{{" :method" , " HEAD" },
1601
+ {" :path" , " /dynamo/url" },
1602
+ {" :scheme" , " http" },
1603
+ {" :authority" , " sni.lyft.com" },
1604
+ {" expect" , " 100-contINUE" }});
1605
+ waitForNextUpstreamRequest ();
1606
+ upstream_request_->encode1xxHeaders (Http::TestResponseHeaderMapImpl{{" :status" , " 102" }});
1607
+ response->waitFor1xxHeaders ();
1608
+ upstream_request_->encodeHeaders (default_response_headers_, true );
1609
+ ASSERT_TRUE (response->waitForEndStream ());
1610
+ }
1611
+
1612
+ TEST_P (DownstreamProtocolIntegrationTest, EnvoyProxying102NoDelayBalsaReset) {
1613
+ if (GetParam ().http1_implementation != Http1ParserImpl::BalsaParser ||
1614
+ GetParam ().upstream_protocol != Http::CodecType::HTTP1) {
1615
+ GTEST_SKIP () << " This test is only relevant for HTTP1 upstream with BalsaParser" ;
1616
+ }
1617
+ config_helper_.addConfigModifier (
1618
+ [&](envoy::extensions::filters::network::http_connection_manager::v3::HttpConnectionManager&
1619
+ hcm) -> void { hcm.set_proxy_100_continue (true ); });
1620
+ config_helper_.addRuntimeOverride (" envoy.reloadable_features.http1_balsa_delay_reset" , " false" );
1621
+ initialize ();
1622
+
1623
+ codec_client_ = makeHttpConnection (lookupPort (" http" ));
1624
+ auto response = codec_client_->makeHeaderOnlyRequest (
1625
+ Http::TestRequestHeaderMapImpl{{" :method" , " HEAD" },
1626
+ {" :path" , " /dynamo/url" },
1627
+ {" :scheme" , " http" },
1628
+ {" :authority" , " sni.lyft.com" },
1629
+ {" expect" , " 100-contINUE" }});
1630
+
1631
+ waitForNextUpstreamRequest ();
1632
+ upstream_request_->encode1xxHeaders (Http::TestResponseHeaderMapImpl{{" :status" , " 102" }});
1633
+ response->waitFor1xxHeaders ();
1634
+ upstream_request_->encodeHeaders (default_response_headers_, true );
1635
+ ASSERT_TRUE (response->waitForEndStream ());
1636
+ }
1637
+
1554
1638
TEST_P (ProtocolIntegrationTest, TwoRequests) { testTwoRequests (); }
1555
1639
1556
1640
TEST_P (ProtocolIntegrationTest, TwoRequestsWithForcedBackup) { testTwoRequests (true ); }
0 commit comments