Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
Signed-off-by: Dan Zhang <[email protected]>
  • Loading branch information
danzh1989 committed Apr 2, 2021
1 parent c860abf commit c4e80a1
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,5 +110,5 @@ All http3 details are rooted at *http3.*
:widths: 1, 2

http3.invalid_header_field, One of the HTTP/3 headers was invalid
http3.headers.too.large, The size of headers (or trailers) exceeded the configured limits
http3.headers_too_large, The size of headers (or trailers) exceeded the configured limits
http3.unexpected_underscore, Envoy was configured to drop or reject requests with header keys beginning with underscores.
2 changes: 1 addition & 1 deletion include/envoy/upstream/upstream.h
Original file line number Diff line number Diff line change
Expand Up @@ -996,7 +996,7 @@ class ClusterInfo {
virtual Http::Http2::CodecStats& http2CodecStats() const PURE;

/**
* @return the Http2 Codec Stats.
* @return the Http3 Codec Stats.
*/
virtual Http::Http3::CodecStats& http3CodecStats() const PURE;

Expand Down
1 change: 1 addition & 0 deletions source/common/http/http1/codec_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,7 @@ Status ConnectionImpl::completeLastHeader() {
ENVOY_CONN_LOG(trace, "completed header: key={} value={}", connection_,
current_header_field_.getStringView(), current_header_value_.getStringView());

// TODO(10646): Switch to use HeaderUtility::checkHeaderNameForUnderscores().
RETURN_IF_ERROR(checkHeaderNameForUnderscores());
auto& headers_or_trailers = headersOrTrailers();
if (!current_header_field_.empty()) {
Expand Down
1 change: 1 addition & 0 deletions source/common/http/http2/codec_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1085,6 +1085,7 @@ int ConnectionImpl::saveHeader(const nghttp2_frame* frame, HeaderString&& name,
return 0;
}

// TODO(10646): Switch to use HeaderUtility::checkHeaderNameForUnderscores().
auto should_return = checkHeaderNameForUnderscores(name.getStringView());
if (should_return) {
stream->setDetails(Http2ResponseCodeDetails::get().invalid_underscore);
Expand Down
6 changes: 4 additions & 2 deletions source/common/quic/envoy_quic_server_session.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,10 @@ quic::QuicSpdyStream* EnvoyQuicServerSession::CreateIncomingStream(quic::QuicStr
return nullptr;
}
if (!codec_stats_.has_value() || !http3_options_.has_value()) {
ENVOY_CONN_LOG(error, "Attempt to create stream {} before HCM filter is initialized.", *this,
id);
ENVOY_BUG(false,
fmt::format(
"Quic session {} attempts to create stream {} before HCM filter is initialized.",
this->id(), id));
return nullptr;
}
auto stream = new EnvoyQuicServerStream(id, this, quic::BIDIRECTIONAL, codec_stats_.value(),
Expand Down

0 comments on commit c4e80a1

Please sign in to comment.