Achieve RFC 9112 HTTP/1.1 Response Syntax
Created November 6, 2026 · Updated November 6, 2026 · Achieve 3.1.0 · Qualified runtime: Node.js 24.22.2
Requirement levels: Sender grammar and framing obligations are mandatory; reason-phrase text is not semantically reliable.
Achieve selects statuses, fields, and content through Node's response API. Node serializes the HTTP/1.1 status line and field section for ordinary responses; Achieve directly constructs only its unsupported CONNECT response on the upgraded socket path.
Applicable requirements
- The status line contains HTTP version, space, three-digit status code, space, and optional reason phrase (RFC 9112 §4).
- MUST: A server sends the separating space even when the reason phrase is empty; clients should ignore the phrase's content.
- MUST NOT: Senders do not generate protocol elements that violate the applicable message grammar.
- Response message length follows the ordered framing rules in §6.3.
Serialization boundary
Achieve uses status codes and headers on the native Node response. Node emits the status line, canonical CRLF delimiters, field lines, Content-Length or chunked framing, and connection termination. Servlet applications can select response metadata through the same API and remain responsible for their own values.
The CONNECT rejection template explicitly emits an HTTP/1.1 status line, Content-Type, exact Content-Length, Connection: close, Date, a blank line, and the UTF-8 body before closing the socket.
Verification and limits
Byte-level tests cover representative 200, redirect, 404, parser-error, conditional, no-content, servlet, and CONNECT responses. They verify status grammar, fields, delimiters, framing, exact lengths, and subsequent connection behavior. This bounded corpus supports the centralized serializer paths; it is not a promise about arbitrary bytes written by application code directly to a socket.
See HTTP/1.1 Message Framing and Content-Length for message-length rules.
