Copilot commented on code in PR #13456:
URL: https://github.com/apache/trafficserver/pull/13456#discussion_r3908657619
##########
src/proxy/CacheControl.cc:
##########
@@ -254,6 +414,73 @@ CacheControlRecord::Init(matcher_line *line_info)
}
}
+ if (is_yaml_rule) {
+ int action_count = cache_responses_to_cookies >= 0 ? 1 : 0;
+
+ for (int i = 0; i < MATCHER_MAX_TOKENS && line_info->num_el; ++i) {
+ label = line_info->line[0][i];
+ val = line_info->line[1][i];
+ if (!label) {
+ continue;
+ }
+
+ bool used = true;
+ if (strcasecmp(label, "yaml_cache") == 0) {
+ if (strcasecmp(val, "never") == 0) {
+ yaml_cache_action = CacheControlType::NEVER_CACHE;
+ } else if (strcasecmp(val, "standard") == 0) {
+ yaml_cache_action = CacheControlType::STANDARD_CACHE;
+ } else {
+ return Result::failure("%s Invalid cache action at line %d in %s",
modulePrefix, line_num, ts::filename::CACHE);
+ }
Review Comment:
These error messages format the filename using `ts::filename::CACHE`. Since
`ts::filename::CACHE` is now `cache.yaml`, any cache-control parse failures
will report `cache.yaml` even when the active configuration is `cache.config`
(i.e. when `proxy.config.cache.control.filename` explicitly selects the legacy
file). It would be more accurate to use the configured filename/path (e.g.
`RecConfigReadConfigPath(CACHE_CONTROL_FILENAME_RECORD)` or the
ControlMatcher’s `config_file_path`) in all CacheControlRecord::Init failures.
--
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]