You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@trafficserver.apache.org by "mohak1 (via GitHub)" <gi...@apache.org> on 2026/10/07 15:25:20 UTC

[PR] hrw4u: map early request headers as inbound [trafficserver]

mohak1 opened a new pull request, #13813:
URL: https://github.com/apache/trafficserver/pull/13813

   `u4wrh` grouped `PRE_REMAP`, `READ_REQUEST`, and `SEND_REQUEST` header operations under `outbound.req`. Its output for either early request hook was therefore rejected when fed back to `hrw4u`, because those hooks operate on the client request represented by `inbound.req`.
   
   Split the reverse mapping so `PRE_REMAP`, `REMAP`, and `READ_REQUEST` emit `inbound.req`, while `SEND_REQUEST` continues to emit `outbound.req`. Add bidirectional fixtures covering `set-header`, `rm-header`, and `add-header` at both affected hooks.
   
   Validation:
   - The issue reproducer now round-trips through `u4wrh` and `hrw4u`.
   - `make test`: 897 passed.
   - Repository formatting and whitespace checks passed.
   
   Fixes: #13619


-- 
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: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] hrw4u: map early request headers as inbound [trafficserver]

Posted by "mohak1 (via GitHub)" <gi...@apache.org>.
mohak1 commented on PR #13813:
URL: https://github.com/apache/trafficserver/pull/13813#issuecomment-6056172173

   Thanks for the review! I've added the missing trailing newline to both txt files


-- 
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: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] hrw4u: map early request headers as inbound [trafficserver]

Posted by "Copilot (via GitHub)" <gi...@apache.org>.
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: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] hrw4u: map early request headers as inbound [trafficserver]

Posted by "masaori335 (via GitHub)" <gi...@apache.org>.
masaori335 commented on PR #13813:
URL: https://github.com/apache/trafficserver/pull/13813#issuecomment-6048467964

   [approve ci]


-- 
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: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] hrw4u: map early request headers as inbound [trafficserver]

Posted by "masaori335 (via GitHub)" <gi...@apache.org>.
masaori335 merged PR #13813:
URL: https://github.com/apache/trafficserver/pull/13813


-- 
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: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org