Achieve — High Level Logic Project. Creating a new meta design pattern.

Friendly in development. Fast in production. Just build your apps. Let Achieve do the rest.

← Back to technical specifications

Achieve RFC 9110 Content-Type and Media Types

Created November 6, 2026 · Updated November 6, 2026 · Achieve 3.1.0 · Qualified runtime: Node.js 24.22.2

Requirement levels: A sender that generates content SHOULD generate Content-Type unless the intended media type is unknown; recipients MAY apply their own fallback when it is absent.

Achieve selects a configured media type for static and audiovisual resources and supplies it as Content-Type. The type describes the selected representation after any content coding is decoded.

Applicable requirements

RFC 9110 §8.3 defines Content-Type as a singleton field carrying a media type. A sender with content SHOULD generate it unless the intended type is unknown. A recipient MAY assume application/octet-stream or inspect data when it is absent; that permission is not a server-side sniffing requirement.

Static and audiovisual resources

Built-in mappings cover the listed HTML, CSS, JavaScript, XML, image, JSON, icon, XSLT, PDF, text, audio, and video suffixes. addMimeType() adds an ordinary static type; addAVMimeType() adds a type to the audiovisual streaming and byte-range path. The leading dot is optional and suffix matching is case-sensitive.

An existing ordinary static file with an unregistered suffix is served with Content-Type: text/plain. This is a configured fallback behavior rather than byte inspection or media-type inference. The reserved .jss family cannot be made public through MIME registration.

Servlet and request content types

Servlet responses begin with text/plain; application code can set another valid response type through the Node response object. For POST input, Achieve automatically buffers and parses JSON and URL-encoded forms within its configured limit. Other content types remain available as the raw request stream. A POST with no Content-Type uses the documented legacy form interpretation and emits a warning.

Verification and responsibility

MIME, static, request-input, POST-content-type, servlet, range, and compression tests verify configured response fields and parsing selection. The static-lookup regression verifies HTTP 200, Content-Type: text/plain, and unchanged bytes for an existing file with an unregistered suffix. Achieve supplies built-in types; applications are responsible for the accuracy of custom registrations and servlet-authored fields. See MIME Types.