Skip to content

Commit

Permalink
router: Add deferred reset error details
Browse files Browse the repository at this point in the history
Signed-off-by: Ali Beyad <abeyad@google.com>
  • Loading branch information
abeyad committed Sep 24, 2024
1 parent 3853027 commit a0a0fa7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions source/common/router/upstream_codec_filter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,10 @@ Http::FilterHeadersStatus UpstreamCodecFilter::decodeHeaders(Http::RequestHeader
// It is possible that encodeHeaders() fails. This can happen if filters or other extensions
// erroneously remove required headers.
callbacks_->streamInfo().setResponseFlag(StreamInfo::CoreResponseFlag::DownstreamProtocolError);
const std::string details =
absl::StrCat(StreamInfo::ResponseCodeDetails::get().FilterRemovedRequiredRequestHeaders,
"{", StringUtil::replaceAllEmptySpace(status.message()), "}");
const std::string details = absl::StrCat(
StreamInfo::ResponseCodeDetails::get().FilterRemovedRequiredRequestHeaders, "{",
deferred_reset_ ? "deferred_reset" : StringUtil::replaceAllEmptySpace(status.message()),
"}");
callbacks_->sendLocalReply(Http::Code::ServiceUnavailable, status.message(), nullptr,
absl::nullopt, details);
return Http::FilterHeadersStatus::StopIteration;
Expand Down

0 comments on commit a0a0fa7

Please sign in to comment.