Rewrite Via decoder as tag-driven parser, add pytest suite

The decoder positionally indexed fixed offsets and rejected anything not
exactly 22 or 6 characters, so real-world vias failed: strings without the
leading client pair, vias whose trailing spaces were stripped in copy/paste
(e.g. cMsSfWpSeN:t cCMpSs), pre-8.0 24-character headers with the ICP tag,
and full Via header lines pasted verbatim.

Extract the logic into content/js/via-decoder.js as a tag-driven parser
mirroring src/traffic_via/traffic_via.cc from apache/trafficserver: lowercase
letters select fields, uppercase letters and spaces are values, ':' or ';'
separates the detail section, and missing trailing values decode as ' '.
This also picks up value codes the page was missing (W read-while-write hit,
R/M/L error codes, N/A tunnel codes, K cookie miss).

The module loads in the browser (window.ViaDecoder) and under node, so
tests/test_via_decoder.py exercises the exact shipped code through node.
Run with: pytest tests/
3 files changed
tree: 801f719c9216922a88f6123a72e1cbc2fadfca5e
  1. content/
  2. docs/
  3. source/
  4. tests/
  5. .asf.yaml
  6. BUILDING.txt