apache / apache/trafficserver

hrw4u: u4wrh emits outbound.req.* into READ_REQUEST/PRE_REMAP, which hrw4u rejects

Open Beginner friendly
#13,619 0 comments 0 reactions 0 assignees View on GitHub
hrw4u
Dominant language
C++
Stars
2k
Forks
874
Avg merge
6d 15h
Merged PRs (30d)
46

Description

Found while reviewing #13204 — reproduces on master.

Input HRW:

```
cond %{READ_REQUEST_HDR_HOOK}
set-header X-Foo "bar"
```

What `u4wrh` produces:

```
READ_REQUEST {
outbound.req.X-Foo = "bar";
}
```

Which `hrw4u` then rejects:

```
error: outbound.req.X-Foo is not available in the READ_REQUEST section
```

The reverse mapping and the section table disagree: `HEADER_CONTEXT_MAP` maps `PRE_REMAP`/`READ_REQUEST`/`SEND_REQUEST` to `outbound.req.` (`src/generators.py:70`), while `OPERATOR_MAP["outbound.req."]` declares `sections={SEND_REQUEST, READ_RESPONSE, SEND_RESPONSE}` (`src/tables.py:52`). `SEND_REQUEST` is fine; `READ_REQUEST` and `PRE_REMAP` are not.

Affects `set-header`, `rm-header` and `add-header` in those two sections.

Contributor guide

Open the contributing guide

Research direction

Start with the section mappings in src/generators.py:70 and src/tables.py:52, then run the shown HRW input through u4wrh and hrw4u. Check the set-header, rm-header, and add-header cases in PRE_REMAP and READ_REQUEST, while preserving the valid SEND_REQUEST behavior; done means hrw4u accepts the generated directives in the affected sections.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
networking
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
78/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.