DCS World Typescript
    Preparing search index...

    Reads a request head incrementally from arbitrary fragments.

    Each call to push appends the new bytes and scans only the lines it has not scanned before, so a head split anywhere (inside the request line, a header, or the CRLF of the terminator) is reconstructed exactly. Lines end with LF; a CR before the LF is removed, so bare-LF clients are accepted. The retained buffer never grows past maxHeaderBytes plus the size of one pushed fragment: once more than maxHeaderBytes bytes are held without a terminator the head is rejected with 431.

    Supported request subset: a request line and headers followed by an optional body framed by a single Content-Length. The following are rejected before any body is read or the handler runs:

    • a header line without a colon, or an empty request line: 400;
    • any Transfer-Encoding (chunked bodies are not supported): 501, or 400 together with Content-Length;
    • a Content-Length that is not a plain decimal number, or several that disagree: 400;
    • a Content-Length above maxBodyBytes: 413;
    • any Expect header (the server never sends 100 Continue): 417;
    • too many header bytes or lines: 431.
    Index