Skip to content

Commit

Permalink
check behavior when trying to send unavailable attribute
Browse files Browse the repository at this point in the history
Signed-off-by: Jacob Bohanon <[email protected]>
  • Loading branch information
jbohanon committed Feb 9, 2024
1 parent 56e76b6 commit fe0d21f
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3437,6 +3437,7 @@ TEST_P(ExtProcIntegrationTest, RequestResponseAttributes) {
proto_config_.mutable_request_attributes()->Add("request.method");
proto_config_.mutable_request_attributes()->Add("request.scheme");
proto_config_.mutable_request_attributes()->Add("connection.mtls");
proto_config_.mutable_request_attributes()->Add("response.code");
proto_config_.mutable_response_attributes()->Add("response.code");
proto_config_.mutable_response_attributes()->Add("response.code_details");

Expand All @@ -3458,6 +3459,9 @@ TEST_P(ExtProcIntegrationTest, RequestResponseAttributes) {
EXPECT_EQ(proto_struct.fields().at("request.method").string_value(), "GET");
EXPECT_EQ(proto_struct.fields().at("request.scheme").string_value(), "http");
EXPECT_EQ(proto_struct.fields().at("connection.mtls").bool_value(), false);
// Make sure we did not include the attribute which was not yet available.
EXPECT_EQ(proto_struct.fields().size(), 4);
EXPECT_FALSE(proto_struct.fields().contains("response.code"));

// Make sure we are not including any data in the deprecated HttpHeaders.attributes.
EXPECT_TRUE(req.request_headers().attributes().empty());
Expand Down

0 comments on commit fe0d21f

Please sign in to comment.