• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

elixir-mint / hpax / 7eea90af881d0fcd10b072cdb99a3f1d4021386b
96%

Build:
DEFAULT BRANCH: main
Ran 27 Jul 2026 08:09AM UTC
Jobs 1
Files 4
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

27 Jul 2026 08:06AM UTC coverage: 95.882%. Remained the same
7eea90af881d0fcd10b072cdb99a3f1d4021386b

push

github

web-flow
Use empty binary, not nil, for static table entries with no default value (#27)

HPAX.Table's @static_table stored `nil` as the value for the many
static entries that have no default (RFC 7541, Appendix A - e.g.
:authority, host, user-agent). Decoding a plain Indexed Header Field
Representation (section 6.1) against one of these entries - fully
legal per the RFC, and something real HTTP/2 clients (and h2spec) do
- returned that literal `nil` as the header value, silently violating
this module's own documented contract that decoded values are always
binaries (HPAX.header_value() :: binary()).

Any caller relying on that contract (e.g. calling byte_size/1 on
every decoded value) would crash on such a request. This also meant
the encoder could never emit a compact single-byte indexed reference
when asked to encode one of these headers with a literal empty-string
value, since the {:full, index} match required by lookup_by_header/3
was guarded with `is_binary(value)` and so never fired for the
nil-valued entries.

Storing "" instead of nil fixes both: decoded values are always
binaries as documented, and encoding a header whose value happens to
be "" for one of these names now correctly compresses to one byte.

* Test that encoding a static entry's default value compresses to one byte

Covers the encoder-side half of the previous commit's fix: headers
whose value matches a static table entry with no defined default
(e.g. "user-agent": "") can now be found via a {:full, index} match
and encoded as a single indexed-header-field byte, rather than always
falling back to a literal encoding because the {:full, _} lookup
clause was guarded with is_binary(value) and so never matched the
old nil-valued entries.

163 of 170 relevant lines covered (95.88%)

4275.42 hits per line

Jobs
ID Job ID Ran Files Coverage
1 7eea90af881d0fcd10b072cdb99a3f1d4021386b.1 27 Jul 2026 08:09AM UTC 4
95.88
GitHub Action Run
Source Files on build 7eea90af881d0fcd10b072cdb99a3f1d4021386b
  • Tree
  • List 4
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 7eea90af on github
  • Prev Build on main (#05ADFDC4...)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc