Skip to content

http1: revert version→505 (llhttp errno ambiguous, net-negative)#54

Merged
EdmondDantes merged 1 commit into
mainfrom
revert-version-505
May 29, 2026
Merged

http1: revert version→505 (llhttp errno ambiguous, net-negative)#54
EdmondDantes merged 1 commit into
mainfrom
revert-version-505

Conversation

@EdmondDantes
Copy link
Copy Markdown
Contributor

The earlier HPE_INVALID_VERSION → 505 change (#53) was net-negative and is reverted.

llhttp reports the same HPE_INVALID_VERSION for two different things:

  • a valid-but-unsupported version (HTTP/1.2) — Http11Probe wants 200 or 505
  • a malformed version string (HTTP/1 missing minor, HTTP/01.1 leading zeros, version whitespace, bare-LF request line) — the probe wants 400

They're indistinguishable from the errno, so mapping all to 505 turned 4 passing checks into failures (COMP-VERSION-MISSING-MINOR/LEADING-ZEROS/WHITESPACE — Must; RFC9112-2.2-BARE-LF — May) to satisfy one May-level check (COMP-HTTP12-VERSION). The probe re-run confirmed it: 155 → 157 with the wrong 4 now red.

Revert to generic 400. COMP-HTTP12-VERSION stays a May-level miss (probe accepts 400 as "rejected"); the 4 malformed-version checks pass again. h1/020 http12 expectation back to 400. tests/phpt 202/202.

Mapping HPE_INVALID_VERSION → 505 was net-negative: llhttp returns that
same errno for BOTH a valid-but-unsupported version (HTTP/1.2) AND a
malformed version string (missing minor, leading zeros, whitespace,
bare-LF request line). Http11Probe wants 400 for the malformed cases
(3 Must + 1 May), so 505-for-all turned 4 passing checks into failures
to "fix" one May-level check (COMP-HTTP12-VERSION). They are
indistinguishable from the errno alone.

Revert to the generic 400. COMP-HTTP12-VERSION stays a (May) miss — the
probe accepts our 400 as "request rejected". h1/020 http12 back to 400.
tests/phpt 202/202.
@github-actions
Copy link
Copy Markdown
Contributor

Coverage

Total lines: 80.80% → 80.66% (-0.14 pp)

File Baseline Current Δ Touched
src/core/http_connection.c 69.65% 67.68% -1.96 pp
src/http1/http_parser.c 82.25% 82.25% +0.00 pp

@EdmondDantes EdmondDantes merged commit fda4183 into main May 29, 2026
8 checks passed
@EdmondDantes EdmondDantes deleted the revert-version-505 branch May 29, 2026 19:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant