Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade Http1ServerConnectionImplTest.Utf8Path/BalsaParser. #23187

Merged
merged 2 commits into from
Sep 27, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Adjust test expecations for BalsaParser.
Signed-off-by: Bence Béky <bnc@google.com>
  • Loading branch information
bnc-google committed Sep 26, 2022
commit 2378ed88ea5a58bc68989ce637475cae48e4e2a8
40 changes: 23 additions & 17 deletions test/common/http/http1/codec_impl_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3286,27 +3286,33 @@ TEST_P(Http1ServerConnectionImplTest, Utf8Path) {

MockRequestDecoder decoder;
Buffer::OwnedImpl buffer("GET /δ¶/δt/pope?q=1#narf HXXP/1.1\r\n\r\n");
#ifdef ENVOY_ENABLE_UHV
// permissive
EXPECT_CALL(callbacks_, newStream(_, _)).WillOnce(ReturnRef(decoder));

TestRequestHeaderMapImpl expected_headers{
{":path", "/δ¶/δt/pope?q=1#narf"},
{":method", "GET"},
};
EXPECT_CALL(decoder, decodeHeaders_(HeaderMapEqual(&expected_headers), true));

auto status = codec_->dispatch(buffer);
EXPECT_TRUE(status.ok());
EXPECT_EQ(0U, buffer.length());
#ifdef ENVOY_ENABLE_UHV
bool strict = false;
#else
// strict
EXPECT_CALL(callbacks_, newStream(_, _)).WillOnce(ReturnRef(decoder));

EXPECT_CALL(decoder, sendLocalReply(_, _, _, _, _));
auto status = codec_->dispatch(buffer);
EXPECT_TRUE(isCodecProtocolError(status));
bool strict = true;
#endif

if (parser_impl_ == ParserImpl::BalsaParser) {
strict = true;
}

if (strict) {
EXPECT_CALL(decoder, sendLocalReply(_, _, _, _, _));
auto status = codec_->dispatch(buffer);
EXPECT_TRUE(isCodecProtocolError(status));
} else {
TestRequestHeaderMapImpl expected_headers{
{":path", "/δ¶/δt/pope?q=1#narf"},
{":method", "GET"},
};
EXPECT_CALL(decoder, decodeHeaders_(HeaderMapEqual(&expected_headers), true));

auto status = codec_->dispatch(buffer);
EXPECT_TRUE(status.ok());
EXPECT_EQ(0U, buffer.length());
}
}

// Tests that incomplete response headers of 80 kB header value fails.
Expand Down