bneradt commented on code in PR #13650:
URL: https://github.com/apache/trafficserver/pull/13650#discussion_r4077298523
##########
plugins/header_rewrite/parser.cc:
##########
@@ -192,6 +193,11 @@ Parser::preprocess(std::vector<std::string> tokens)
_mods.push_back(m);
}
tokens.pop_back(); // consume it, so we don't concatenate it into the
value
+
+ if (tokens.empty()) {
+ TSError("[%s] modifiers must follow a condition or operator: %s",
PLUGIN_NAME, flags.c_str());
+ return false;
+ }
Review Comment:
Fixed in cbdd1da62b. The parser now rejects an empty token list immediately
after consuming the cond keyword. Regression coverage includes bare cond, cond
[L], and cond with a long modifier list. Build/install, formatting,
test_header_rewrite via ctest, and the header_rewrite_orphan_modifiers and
header_rewrite_bundle AuTests all passed in the Docker build environment.
--
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]