apache / apache/trafficserver

Via Header: Document legacy codes and clarify decoder behavior

Open
#12,795 1 comment 0 reactions 1 assignee Claimed by @bryancall View on GitHub
Documentation
Dominant language
C++
Stars
2k
Forks
874
Avg merge
6d 15h
Merged PRs (30d)
46

Description

## Summary

Investigation by Kyle Duren revealed inconsistencies between the Via header documentation, legacy decoder scripts, and current ATS behavior.

## Key Findings

### 1. JavaScript Decoder Coverage ✅
The current JavaScript decoder on trafficserver.apache.org covers **all codes** that the server currently generates.

### 2. Legacy Codes (no longer generated by server)
The following codes exist in older decoders but are **not generated by current ATS**:

| Code | Position | Meaning | Source |
|------|----------|---------|--------|
| `I` | Cache Type | "icp" | Legacy Perl script |
| `L` | Cache Type | "cluster (not used)" | Legacy C++ CLI tool |

These should either be:
- Documented as legacy/deprecated, or
- Removed from decoders if no longer relevant

### 3. Default Values
The server initializes Via header positions as follows (see `proxy/http/HttpTransact.cc` lines 827-849):
- All positions: `' '` (space)
- ERROR_TYPE: `'N'` (no error)

This initialization behavior should be documented.

### 4. Documentation Sources Inconsistency
There are discrepancies between:
- Official ATS documentation
- Legacy Perl decoder script
- C++ CLI tool (`traffic_via`)
- Header files in ATS source

## Proposed Actions

1. [ ] Audit Via header codes in source (`HttpTransact.cc`, `HttpTransactHeaders.cc`)
2. [ ] Update documentation to reflect current behavior
3. [ ] Mark legacy codes (I, L) as deprecated or remove from decoders
4. [ ] Document default initialization values
5. [ ] Ensure consistency between docs, website decoder, and `traffic_via` tool

## References

- Via Header Decoder: https://trafficserver.apache.org/via
- `traffic_via` tool: `src/traffic_via/`
- Via header generation: `proxy/http/HttpTransact.cc`

/cc @bryancall

---
*Reported by: Kyle Duren*

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.