FA-76389 / Email MIME structure / Member archive
Resolve a part's effective content type and charset: invalid type fallback · case 04
A malformed type such as "text/" or "/html" is used verbatim instead of falling back to the default.
Case contract
header is the raw Content-Type value or None. The type is the lower-cased text before ";" with surrounding spaces removed; it is valid only with a non-empty major and minor separated by "/" and no inner space. Missing or invalid types default to message/rfc822 inside multipart/digest and text/plain everywhere else (parameters of an invalid header are ignored). text/* types get the charset parameter (quotes removed, lower-cased) or us-ascii; other types have charset None. Result [type, charset].
Why this case matters
Default and fallback types decide whether a part is rendered as text, as a nested message or as an attachment.
One recorded failure
Sample boundary fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| truncated type in digest | ["text/", "us-ascii"] | ["message/rfc822", null] | Failed |
MEMBER ARCHIVE
The complete case is available to members.
This record includes three runnable implementations, regression fixtures, execution results, and source hashes.
Member access is invitation-based. Sign in with your invited account to inspect the sources.
Sign in to the archive ↗