diff --git a/plugins/header_rewrite/operators.cc b/plugins/header_rewrite/operators.cc index fda921cf2be..da14d35fdc3 100644 --- a/plugins/header_rewrite/operators.cc +++ b/plugins/header_rewrite/operators.cc @@ -383,12 +383,11 @@ void OperatorAddHeader::exec(const Resources& res) const { std::string value; + _value.append_value(value, res); VariableExpander ve(value); value = ve.expand(res); - _value.append_value(value, res); - // Never set an empty header (I don't think that ever makes sense?) if (value.empty()) { TSDebug(PLUGIN_NAME, "Would set header %s to an empty value, skipping", _header.c_str());