Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(747)

Unified Diff: net/tools/quic/end_to_end_test.cc

Issue 2430513002: Limit QUIC uncompressed header size per stream to 16K, by default. Protected by FLAGS_quic_limit_un… (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/quic/core/quic_utils.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/tools/quic/end_to_end_test.cc
diff --git a/net/tools/quic/end_to_end_test.cc b/net/tools/quic/end_to_end_test.cc
index 9201152cab9ad2a8be5d1bee0ffa6ab5ca4bfed9..2dab5cf1c28438dd9797dfb3e6b26508b997b96c 100644
--- a/net/tools/quic/end_to_end_test.cc
+++ b/net/tools/quic/end_to_end_test.cc
@@ -1180,6 +1180,32 @@ TEST_P(EndToEndTest, InvalidStream) {
EXPECT_EQ(QUIC_INVALID_STREAM_ID, client_->connection_error());
}
+// Test that if the the server will close the connection if the client attempts
+// to send a request with overly large headers.
+TEST_P(EndToEndTest, LargeHeaders) {
+ ASSERT_TRUE(Initialize());
+ client_->client()->WaitForCryptoHandshakeConfirmed();
+
+ string body;
+ test::GenerateBody(&body, kMaxPacketSize);
+
+ HTTPMessage request(HttpConstants::HTTP_1_1, HttpConstants::POST, "/foo");
+ request.AddHeader("key1", string(15 * 1024, 'a'));
+ request.AddHeader("key2", string(15 * 1024, 'a'));
+ request.AddHeader("key3", string(15 * 1024, 'a'));
+ request.AddBody(body, true);
+
+ client_->SendCustomSynchronousRequest(request);
+ if (FLAGS_quic_limit_uncompressed_headers) {
+ EXPECT_EQ(QUIC_HEADERS_TOO_LARGE, client_->stream_error());
+ } else {
+ EXPECT_EQ(QUIC_STREAM_NO_ERROR, client_->stream_error());
+ EXPECT_EQ(kFooResponseBody, client_->response_body());
+ EXPECT_EQ(200u, client_->response_headers()->parsed_response_code());
+ }
+ EXPECT_EQ(QUIC_NO_ERROR, client_->connection_error());
+}
+
TEST_P(EndToEndTest, EarlyResponseWithQuicStreamNoError) {
ASSERT_TRUE(Initialize());
client_->client()->WaitForCryptoHandshakeConfirmed();
« no previous file with comments | « net/quic/core/quic_utils.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698