Skip to content

HTTP correctness hygiene (not benchmark-scoring): Accept-Encoding q=0 ignored, missing Vary, Connection: close ignored, HEAD unhandled #88

Description

@enghitalo

Latent correctness/HTTP-hygiene gaps found while auditing the HttpArena entries. None are exercised by the current benchmark (so they don't affect scores), but they're real spec deviations worth fixing for general use. Grouped into one tracking issue:

  1. Accept-Encoding q-values ignoredaccepts_gzip does only .contains('gzip') (frameworks/vanilla-epoll/main.v:1119, io_uring :663), so gzip;q=0 (explicitly refused) would still get a gzipped response. Should parse q-values (the lib's static_assets already has slice_accepts_token / q_value_is_zero to mirror).
  2. Vary: Accept-Encoding missing on the json-comp gzip response (main.v:896) — content-negotiated responses should send Vary so caches don't serve the wrong encoding. (The static_assets path already sets it correctly.)
  3. Connection: close ignored — every response hardcodes Connection: keep-alive; a client requesting close still gets keep-alive. Benchmark is all keep-alive, so no impact, but it's non-conformant.
  4. HEAD not handled — neither entry branches on HEAD, so a HEAD would receive a full body. No HEAD in the benchmark/validate.sh.

These can be fixed in the entries (1–4) and/or surfaced from the lib (q-value parsing already exists in static_assets). Low priority; filed for completeness.

Fix location: HttpArena entries (both) + reuse http_server/static_assets q-value helpers in the lib.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions