diff --git a/test/extensions/filters/http/ext_proc/ext_proc_integration_test.cc b/test/extensions/filters/http/ext_proc/ext_proc_integration_test.cc index fdfaec08ebbf..32e7b9ffd059 100644 --- a/test/extensions/filters/http/ext_proc/ext_proc_integration_test.cc +++ b/test/extensions/filters/http/ext_proc/ext_proc_integration_test.cc @@ -1038,9 +1038,9 @@ TEST_P(ExtProcIntegrationTest, GetAndSetBodyAndHeadersAndTrailersOnResponse) { EXPECT_THAT(*(response->trailers()), SingleHeaderValueIs("x-modified-trailers", "xxx")); } -// Test the filter using a configuration that processes response trailers, and process an upstream -// response that has no trailers. -TEST_P(ExtProcIntegrationTest, AddTrailersOnResponse) { +// Test the filter using a configuration that sends response headers and trailers, +// and process an upstream response that has no trailers. +TEST_P(ExtProcIntegrationTest, NoTrailersOnResponseWithModeSendHeaderTrailer) { proto_config_.mutable_processing_mode()->set_response_trailer_mode(ProcessingMode::SEND); initializeConfig(); HttpIntegrationTest::initialize(); @@ -1052,6 +1052,22 @@ TEST_P(ExtProcIntegrationTest, AddTrailersOnResponse) { verifyDownstreamResponse(*response, 200); } +// Test the filter using a configuration that sends response body and trailers, and process +// an upstream response that has no trailers. +TEST_P(ExtProcIntegrationTest, NoTrailersOnResponseWithModeSendBodyTrailer) { + proto_config_.mutable_processing_mode()->set_request_header_mode(ProcessingMode::SKIP); + proto_config_.mutable_processing_mode()->set_response_header_mode(ProcessingMode::SKIP); + proto_config_.mutable_processing_mode()->set_response_body_mode(ProcessingMode::BUFFERED); + proto_config_.mutable_processing_mode()->set_response_trailer_mode(ProcessingMode::SEND); + initializeConfig(); + HttpIntegrationTest::initialize(); + auto response = sendDownstreamRequest(absl::nullopt); + handleUpstreamRequest(); + processResponseBodyMessage(*grpc_upstreams_[0], true, absl::nullopt); + + verifyDownstreamResponse(*response, 200); +} + // Test the filter with a response body callback enabled using an // an ext_proc server that responds to the response_body message // by requesting to modify the response body and headers, using a response