Skip to content

Commit

Permalink
test: Add multiheader TE + Content-Length test (#14686)
Browse files Browse the repository at this point in the history
Signed-off-by: Yan Avlasov <yavlasov@google.com>
  • Loading branch information
yanavlasov authored Jan 14, 2021
1 parent eca8065 commit cfd1532
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/integration/integration_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,17 @@ TEST_P(IntegrationTest, TestSmuggling) {
sendRawHttpAndWaitForResponse(lookupPort("http"), request.c_str(), &response, false);
EXPECT_THAT(response, HasSubstr("HTTP/1.1 400 Bad Request\r\n"));
}
{
// Verify that sending `Transfer-Encoding: chunked` as a second header is detected and triggers
// the "no Transfer-Encoding + Content-Length" check.
std::string response;
const std::string request =
"GET / HTTP/1.1\r\nHost: host\r\ntransfer-encoding: "
"identity\r\ncontent-length: 36\r\ntransfer-encoding: chunked \r\n\r\n" +
smuggled_request;
sendRawHttpAndWaitForResponse(lookupPort("http"), request.c_str(), &response, false);
EXPECT_THAT(response, HasSubstr("HTTP/1.1 400 Bad Request\r\n"));
}
}

TEST_P(IntegrationTest, TestPipelinedResponses) {
Expand Down

0 comments on commit cfd1532

Please sign in to comment.