+ std::string sheader(header->name);
+ sheader += ": ";
+ sheader += header->value;
+
+ RulePtr rule = it->rule;
+ std::string out = rule->test_patterns(vars, sheader);
+ if (!out.empty())
+ {
+ size_t pos = out.find(": ");
+ if (pos == std::string::npos)
+ {
+ yaz_log(YLOG_LOG, "Header malformed during rewrite, ignoring");
+ continue;
+ }
+ header->name = odr_strdup(o, out.substr(0, pos).c_str());
+ header->value = odr_strdup(o,
+ out.substr(pos + 2,
+ std::string::npos).c_str());
+ }