Copilot commented on code in PR #13206:
URL: https://github.com/apache/trafficserver/pull/13206#discussion_r3325890900
##########
tools/hrw4u/src/hrw_visitor.py:
##########
@@ -66,13 +66,10 @@ def _cached_percent_parsing(self, pct_text: str) ->
tuple[str, str | None]:
return self.symbol_resolver.parse_percent_block(pct_text)
@lru_cache(maxsize=256)
- def _cached_symbol_to_ident(self, pct_text: str, section_name: str) ->
tuple[str, str]:
+ def _cached_symbol_to_ident(self, pct_text: str, section_name: str) ->
tuple[str, bool]:
"""Cache expensive symbol resolution operations."""
- try:
- section = SectionType(section_name)
- return self.symbol_resolver.percent_to_ident_or_func(pct_text,
section)
- except (ValueError, SymbolResolutionError):
- return pct_text, ""
+ section = SectionType(section_name)
+ return self.symbol_resolver.percent_to_ident_or_func(pct_text, section)
Review Comment:
Unmapped percent tags are still silently passed through when they appear
inside operator arguments, because those paths do not use this cached
condition/comparison resolver. For example, an HRW line such as `set-header X
"%{UNKNOWN}"` still goes through inline percent rewriting and can emit raw
`%{...}` text instead of reporting a reverse-resolution error, so future
mapping gaps can still hide outside `cond` expressions.
--
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]