Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion source/common/quic/envoy_quic_server_stream.cc
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ void EnvoyQuicServerStream::OnInitialHeadersComplete(bool fin, size_t frame_len,
}
std::unique_ptr<Http::RequestHeaderMapImpl> headers =
quicHeadersToEnvoyHeaders<Http::RequestHeaderMapImpl>(header_list);
if (!Http::HeaderUtility::authorityIsValid(headers->Host()->value().getStringView())) {
if (Http::HeaderUtility::requestHeadersValid(*headers) != absl::nullopt) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

Want to set details here or wait and add them all at once?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will set invalid http header response code in #15753

stream_delegate()->OnStreamError(quic::QUIC_HTTP_FRAME_ERROR, "Invalid headers");
return;
}
Expand Down
15 changes: 15 additions & 0 deletions test/common/quic/integration/quic_http_integration_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,21 @@ TEST_P(QuicHttpIntegrationTest, Reset101SwitchProtocolResponse) {
EXPECT_FALSE(response->complete());
}

TEST_P(QuicHttpIntegrationTest, ResetRequestWithoutAuthorityHeader) {
initialize();

codec_client_ = makeHttpConnection(lookupPort("http"));
auto encoder_decoder = codec_client_->startRequest(Http::TestRequestHeaderMapImpl{
{":method", "GET"}, {":path", "/dynamo/url"}, {":scheme", "http"}});
request_encoder_ = &encoder_decoder.first;
auto response = std::move(encoder_decoder.second);

response->waitForEndStream();
codec_client_->close();
ASSERT_TRUE(response->complete());
EXPECT_EQ("400", response->headers().getStatusValue());
}

TEST_P(QuicHttpIntegrationTest, MultipleSetCookieAndCookieHeaders) {
initialize();

Expand Down