1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
//! A client-side HTTP/1.1 codec we own.
//!
//! ADR-0001 removes every third-party HTTP implementation from the production
//! path because the request trace must map *bytes* to *frames* without a foreign
//! buffer in between. This crate is that codec: it serializes a request, parses
//! a response head, and decodes the body framing — nothing else. It holds no
//! connection, no pool, no policy and no clock.
//!
//! # Scope, stated exactly
//!
//! Supported (RFC 9112, client side):
//!
//! - request line + header serialization with a length-delimited body;
//! - response status line and header parsing (case-insensitive names, duplicate
//! headers preserved, obsolete line folding rejected);
//! - body framing: `Content-Length`, `Transfer-Encoding: chunked` (chunk
//! extensions and trailers), close-delimited bodies, and the no-body cases
//! (`HEAD`, `1xx`, `204`, `304`);
//! - hard limits on head size, header count and chunk size, with typed errors
//! and no panics.
//!
//! Deliberately out of scope: HTTP/2 and above, server-side parsing, content
//! negotiation, redirects, compression, and connection pooling — those live in
//! `netune` (policy) or are simply not needed.
//!
//! # Why `http` is still a dependency
//!
//! `http` is a *data-type* crate: `Method`, `StatusCode`, `HeaderMap`. It carries
//! no parsing, no I/O and no policy, so keeping it does not put foreign
//! behaviour in the measurement path. Everything that turns bytes into state is
//! here.
//!
//! # Correctness posture
//!
//! The parser is accepted against a differential oracle (hyper) over a recorded
//! corpus, fuzzed for panics, and bounded by [`Limits`]. See
//! `tests/differential.rs`.
pub use HttpError;
pub use ;
pub use ;
pub use write_request;