lordgamez commented on code in PR #1362:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1362#discussion_r911883288
##########
extensions/librdkafka/PublishKafka.cpp:
##########
@@ -184,12 +184,12 @@ class ReadCallback {
});
}
- static rd_kafka_headers_unique_ptr make_headers(const core::FlowFile&
flow_file, utils::Regex& attribute_name_regex) {
+ static rd_kafka_headers_unique_ptr make_headers(const core::FlowFile&
flow_file, std::optional<utils::Regex>& attribute_name_regex) {
const gsl::owner<rd_kafka_headers_t*> result{ rd_kafka_headers_new(8) };
if (!result) { throw std::bad_alloc{}; }
for (const auto& kv : flow_file.getAttributes()) {
- if (utils::regexSearch(kv.first, attribute_name_regex)) {
+ if (attribute_name_regex && utils::regexSearch(kv.first,
*attribute_name_regex)) {
Review Comment:
Good idea, updated in 2c70c9d7f88a3b7568408c2b45c44516b199ae37
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]