You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by ma...@apache.org on 2026/10/09 04:31:45 UTC

(trafficserver) branch master updated: hrw4u: map early request headers as inbound (#13813)

This is an automated email from the ASF dual-hosted git repository.

masaori335 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
     new 95c5217fc9 hrw4u: map early request headers as inbound (#13813)
95c5217fc9 is described below

commit 95c5217fc960620ef24fc0d2bee4436f68cce15e
Author: Mohak Narang <na...@gmail.com>
AuthorDate: Fri Oct 9 05:31:38 2026 +0100

    hrw4u: map early request headers as inbound (#13813)
    
    * hrw4u: map early request headers as inbound
    
    Make u4wrh emit client request header targets at PRE_REMAP and READ_REQUEST so its output remains valid input to hrw4u.
    
    Fixes: #13619
    
    * test: add newlines to hrw4u fixtures
---
 tools/hrw4u/src/generators.py                           |  4 ++--
 tools/hrw4u/tests/data/hooks/request_headers.input.txt  | 11 +++++++++++
 tools/hrw4u/tests/data/hooks/request_headers.output.txt |  9 +++++++++
 3 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/tools/hrw4u/src/generators.py b/tools/hrw4u/src/generators.py
index 20c00ce35b..3f2497fe96 100644
--- a/tools/hrw4u/src/generators.py
+++ b/tools/hrw4u/src/generators.py
@@ -66,8 +66,8 @@ class TableGenerator:
         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.",
                     SectionType.READ_RESPONSE: "outbound.resp."
                 },
             "URL_CONTEXT_MAP":
diff --git a/tools/hrw4u/tests/data/hooks/request_headers.input.txt b/tools/hrw4u/tests/data/hooks/request_headers.input.txt
new file mode 100644
index 0000000000..a424b665a0
--- /dev/null
+++ b/tools/hrw4u/tests/data/hooks/request_headers.input.txt
@@ -0,0 +1,11 @@
+PRE_REMAP {
+    inbound.req.X-Set = "pre-remap";
+    inbound.req.X-Remove = "";
+    inbound.req.X-Add += "pre-remap";
+}
+
+READ_REQUEST {
+    inbound.req.X-Set = "read-request";
+    inbound.req.X-Remove = "";
+    inbound.req.X-Add += "read-request";
+}
diff --git a/tools/hrw4u/tests/data/hooks/request_headers.output.txt b/tools/hrw4u/tests/data/hooks/request_headers.output.txt
new file mode 100644
index 0000000000..9022c15aa0
--- /dev/null
+++ b/tools/hrw4u/tests/data/hooks/request_headers.output.txt
@@ -0,0 +1,9 @@
+cond %{READ_REQUEST_PRE_REMAP_HOOK} [AND]
+    set-header X-Set "pre-remap"
+    rm-header X-Remove
+    add-header X-Add "pre-remap"
+
+cond %{READ_REQUEST_HDR_HOOK} [AND]
+    set-header X-Set "read-request"
+    rm-header X-Remove
+    add-header X-Add "read-request"