Skip to content

Commit

Permalink
ext_proc: Fix status code in the test (envoyproxy#35056)
Browse files Browse the repository at this point in the history
500 is returned because the onMessageTimeout is invoked by mistake,
which is because test is missing skip_header_processing_on_response (or
ext_proc test server should handle request)

404 should be returned from upstream sever in this case, as downstream
client request failed to reach the server due to route mismatch.

---------

Signed-off-by: tyxia <[email protected]>
  • Loading branch information
tyxia authored Jul 8, 2024
1 parent 8f246ac commit bb9fbf0
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1024,6 +1024,9 @@ TEST_P(ExtProcIntegrationTest, SetHostHeaderRoutingSucceeded) {

TEST_P(ExtProcIntegrationTest, SetHostHeaderRoutingFailed) {
proto_config_.mutable_mutation_rules()->mutable_allow_all_routing()->set_value(true);
// Skip the header processing on response path.
proto_config_.mutable_processing_mode()->set_response_header_mode(ProcessingMode::SKIP);

initializeConfig();
// Set up the route config.
std::string vhost_domain = "new_host";
Expand Down Expand Up @@ -1060,9 +1063,9 @@ TEST_P(ExtProcIntegrationTest, SetHostHeaderRoutingFailed) {
return true;
});

// The routing to upstream is expected to fail and 500 is returned to downstream client, since no
// The routing to upstream is expected to fail and 404 is returned to downstream client, since no
// route is found for mismatched vhost.
verifyDownstreamResponse(*response, 500);
verifyDownstreamResponse(*response, 404);
}

TEST_P(ExtProcIntegrationTest, GetAndSetPathHeader) {
Expand Down

0 comments on commit bb9fbf0

Please sign in to comment.