bneradt commented on code in PR #13486:
URL: https://github.com/apache/trafficserver/pull/13486#discussion_r3714136918


##########
tests/gold_tests/pluginTest/header_rewrite/post_remap.conf:
##########
@@ -17,11 +17,16 @@
 
 # Global header_rewrite ruleset that fires after remapping, on the remapped
 # request, before the cache lookup. The value is the remapped host, so an
-# earlier hook would record the pristine host instead.
+# earlier hook would record the pristine host instead. Setting a state flag
+# also verifies that operators which inherit the default hook list are valid
+# at POST_REMAP_HOOK.
 cond %{POST_REMAP_HOOK}
+  set-state-flag 0 true
   set-header X-Post-Remap-Host "%{URL:HOST}"
 
 # Echo the post-remap header into the client response so the rule above can be
-# observed on a cache hit, where no request is forwarded to the origin.
+# observed on a cache hit, where no request is forwarded to the origin. The
+# state condition proves that the state operator also ran at POST_REMAP_HOOK.
 cond %{SEND_RESPONSE_HDR_HOOK}
+cond %{STATE-FLAG:0} =TRUE
   set-header X-Post-Remap-Echo "%{CLIENT-HEADER:X-Post-Remap-Host}"

Review Comment:
   Thanks for checking this. Indentation does not affect header_rewrite 
grouping: RulesConfig::parse_config() strips all leading whitespace before 
tokenization. SEND_RESPONSE_HDR_HOOK is a hook selector that creates the 
ruleset, not a Boolean condition. The following STATE-FLAG condition is 
therefore added to that same SEND_RESPONSE ruleset, and the set-header operator 
completes it. This form also matches existing header_rewrite configurations. 
The focused POST_REMAP AuTest passes as written, so no indentation change is 
needed.



-- 
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]

Reply via email to