Media type
A media type identifies a data format and its intended processing model using a type, subtype and optional parameters.
Declaration: In HTTP, Content-Type carries a media type such as text/plain; charset=utf-8. Type and subtype names are case-insensitive; parameter values follow their own rules. A media type is distinct from a filename extension or a content encoding such as gzip. Distinct media types may share the same data format while specifying different processing models; inspecting bytes alone cannot always recover the intended interpretation. [1]
Stored metadata: S3 exposes Content-Type as user-controlled system metadata. It is not a checksum or a result of validating every byte of an object. Retain the interpretation metadata alongside the selected bytes. A version selector and metadata validation answer separate questions. [3]
Identification: Magic bytes and filename extensions are separate clues to a media type. A matching signature does not establish that the remaining file satisfies the format. HTTP content sniffing can also select an unintended processing model. [2] [1]
Response boundaries: Content-Type is a singleton, not a comma-separated list; conflicting copies can produce different recipient interpretations. [1] Barth, Caballero and Song's 2009 study showed how upload filters and then-current browser sniffers could assign incompatible types to the same file. This is historical evidence, not a claim that current browsers retain those attacks. [4]
Relations
Citations
- RFC 9110: Content-Type and media types, sections 8.3 and 8.3.1
- RFC 6838: additional media-type identification information, section 4.12
- Amazon S3: system-defined object metadata
- Barth, Caballero and Song (IEEE S&P 2009): content sniffing, sections 2.3-3.4
Further reading
Sources & caveats
- Primary-source terminology for HTTP and stored-object interpretation; no live object-store experiment or browser security evaluation.