Skip to content

Add HTTP request-parsing edge-case tests - #14

Merged
mattsva merged 1 commit into
mnet-web:mainfrom
mattsva:test/http-edge-cases
Oct 11, 2026
Merged

mattsva merged 1 commit into
mnet-web:mainfrom
mattsva:test/http-edge-cases

Conversation

@mattsva

@mattsva mattsva commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

No linked issue — the audit verdict for these parsing edge cases was NOT PRESENT (the parser already handles them correctly). This PR locks the behaviour in with tests rather than changing code.

Covers: duplicate Content-Length with different values (→ 400), Content-Length + Transfer-Encoding (→ 501), bare LF and obs-fold continuation lines, Expect: 100-continue, negative/overflowing/non-numeric Content-Length (→ 400/413), request line without HTTP version, spaces before the colon, and pipelined requests. 11 checks, all passing against the current parser.

Two deliberate lenient behaviours — bare LF accepted, version-less request line served — are documented in the test rather than changed. Wired into Make, CMake, Meson and CI.

Stacked on the previous PR in the series; merge in order.

@mattsva
mattsva force-pushed the test/http-edge-cases branch 2 times, most recently from 5686722 to 9f5d206 Compare October 11, 2026 13:37
Covers duplicate Content-Length (400), Content-Length with
Transfer-Encoding (501), bare LF line endings, obs-fold continuations,
Expect: 100-continue, negative/overflowing/non-numeric Content-Length
(400/413/400), a version-less request line, a space before a header
colon, and pipelined requests.

No source changes were needed: every case already behaves correctly.
The tests document the behavior and guard it, including the two
deliberately lenient choices (obs-fold and a version-less request line
are served rather than rejected, per the existing lenient policy).

Wired into Make, CMake, Meson and the CI jobs.
@mattsva
mattsva force-pushed the test/http-edge-cases branch from 9f5d206 to b58b553 Compare October 11, 2026 13:45
@mattsva
mattsva merged commit ca5f1ae into mnet-web:main Oct 11, 2026
8 checks passed
@mattsva
mattsva deleted the test/http-edge-cases branch October 11, 2026 14:10
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