@@ -68,15 +68,17 @@ TransformerInstance::TransformerInstance(
68
68
const std::map<std::string, std::string> &extractions, const json &context)
69
69
: header_map_(header_map), extractions_(extractions), context_(context) {
70
70
env_.add_callback (
71
- " header" , 1 ,
72
- std::bind (&TransformerInstance::header_callback, this , _1, _2));
71
+ " header" , 1 , [this ](Arguments args) {
72
+ return header_callback (args);
73
+ });
73
74
env_.add_callback (
74
- " extraction" , 1 ,
75
- std::bind (&TransformerInstance::extracted_callback, this , _1, _2));
75
+ " extraction" , 1 , [this ](Arguments args) {
76
+ return extracted_callback (args);
77
+ });
76
78
}
77
79
78
- json TransformerInstance::header_callback (Parsed:: Arguments args, json data ) {
79
- std::string headername = env_. get_argument <std::string>(args, 0 , data );
80
+ json TransformerInstance::header_callback (Arguments args) {
81
+ std::string headername = args. at ( 0 )-> get <std::string>();
80
82
const Http::HeaderEntry *header_entry =
81
83
getHeader (header_map_, std::move (headername));
82
84
if (!header_entry) {
@@ -85,9 +87,8 @@ json TransformerInstance::header_callback(Parsed::Arguments args, json data) {
85
87
return std::string (header_entry->value ().getStringView ());
86
88
}
87
89
88
- json TransformerInstance::extracted_callback (Parsed::Arguments args,
89
- json data) {
90
- std::string name = env_.get_argument <std::string>(args, 0 , data);
90
+ json TransformerInstance::extracted_callback (Arguments args) {
91
+ std::string name = args.at (0 )->get <std::string>();
91
92
const auto value_it = extractions_.find (name);
92
93
if (value_it != extractions_.end ()) {
93
94
return value_it->second ;
0 commit comments