Copilot commented on code in PR #13813:
URL: https://github.com/apache/trafficserver/pull/13813#discussion_r4216978962


##########
tools/hrw4u/src/generators.py:
##########
@@ -66,8 +66,8 @@ def generate_context_mappings(self) -> dict[str, 
dict[SectionType | frozenset[Se
         return {
             "HEADER_CONTEXT_MAP":
                 {
-                    SectionType.REMAP: "inbound.req.",
-                    frozenset({SectionType.PRE_REMAP, 
SectionType.READ_REQUEST, SectionType.SEND_REQUEST}): "outbound.req.",
+                    frozenset({SectionType.PRE_REMAP, SectionType.REMAP, 
SectionType.READ_REQUEST}): "inbound.req.",

Review Comment:
   By moving `SectionType.REMAP` from its own key to a `frozenset` key, the 
mapping is no longer directly addressable via 
`HEADER_CONTEXT_MAP[SectionType.REMAP]` (if any code path does direct lookup 
rather than iterating `frozenset` keys). Keeping an explicit 
`SectionType.REMAP: \"inbound.req.\"` entry (and a separate 
`frozenset({SectionType.PRE_REMAP, SectionType.READ_REQUEST})`) avoids relying 
on implicit lookup behavior and makes the mapping intent clearer.



##########
tools/hrw4u/src/generators.py:
##########
@@ -66,8 +66,8 @@ def generate_context_mappings(self) -> dict[str, 
dict[SectionType | frozenset[Se
         return {
             "HEADER_CONTEXT_MAP":
                 {
-                    SectionType.REMAP: "inbound.req.",
-                    frozenset({SectionType.PRE_REMAP, 
SectionType.READ_REQUEST, SectionType.SEND_REQUEST}): "outbound.req.",
+                    frozenset({SectionType.PRE_REMAP, SectionType.REMAP, 
SectionType.READ_REQUEST}): "inbound.req.",
+                    SectionType.SEND_REQUEST: "outbound.req.",

Review Comment:
   This change explicitly alters behavior for `SectionType.REMAP`, but the 
added fixtures only cover `PRE_REMAP` and `READ_REQUEST`. Add a `REMAP { ... }` 
fixture (and corresponding expected output) so the new `REMAP -> inbound.req` 
mapping is regression-tested.



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