zwoop commented on code in PR #12009: URL: https://github.com/apache/trafficserver/pull/12009#discussion_r1939880736
########## plugins/header_rewrite/conditions.h: ########## @@ -659,3 +659,68 @@ class ConditionHttpCntl : public Condition private: TSHttpCntlType _http_cntl_qual = TS_HTTP_CNTL_LOGGING_MODE; }; + +class ConditionGroup : public Condition +{ +public: + ConditionGroup() { Dbg(dbg_ctl, "Calling CTOR for ConditionGroup"); } + + ~ConditionGroup() override + { + Dbg(dbg_ctl, "Calling DTOR for ConditionGroup"); + delete _cond; + } + + void + set_qualifier(const std::string &q) override + { + Condition::set_qualifier(q); + + if (!q.empty()) { // Anything goes here, but prefer END + _end = true; + } + } + + // noncopyable + ConditionGroup(const ConditionGroup &) = delete; + void operator=(const ConditionGroup &) = delete; + + bool + closes() const + { + return _end; + } + + void + append_value(std::string & /* s ATS_UNUSED */, const Resources & /* res ATS_UNUSED */) override + { + TSReleaseAssert(!"%{GROUP} should never be used as a condition value!"); Review Comment: > Should this release assert? Maybe an error instead? Changed to a debug release, and a TSError. Note that this is a runtime "error", so it won't fail configuration loading / reloading here. That'd require a different change / refactoring I think. -- 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: github-unsubscr...@trafficserver.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org