Skip to content

Commit

Permalink
mobile: direct response cleanup (envoyproxy#35621)
Browse files Browse the repository at this point in the history
Signed-off-by: Alyssa Wilk <[email protected]>
  • Loading branch information
alyssawilk authored Aug 7, 2024
1 parent 770b151 commit d78e813
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions mobile/library/common/http/header_utility.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,9 @@ namespace Envoy {
namespace Http {
namespace Utility {

Http::LocalErrorStatus statusForOnLocalReply(const StreamDecoderFilter::LocalReplyData& reply,
const StreamInfo::StreamInfo& info) {
// This is a horrible hack to work around legacy swift direct response API.
// TODO(https://github.com/envoyproxy/envoy/issues/24428) remove.
if (reply.details_ == "direct_response" && info.getRequestHeaders() &&
info.getRequestHeaders()->getHostValue() == "127.0.0.1") {
return Http::LocalErrorStatus::Continue;
}
Http::LocalErrorStatus statusForOnLocalReply(const StreamDecoderFilter::LocalReplyData&,
const StreamInfo::StreamInfo&) {
// Avoid sendLocalReply to differentiate Envoy generated errors from peer generated errors.
return Http::LocalErrorStatus::ContinueAndResetStream;
}

Expand Down

0 comments on commit d78e813

Please sign in to comment.