FA-76474 / Email MIME structure / Member archive
Resolve cid: references inside multipart/related: scheme case · case 04
References written as "CID:" are not recognised as content-id URLs.
Case contract
related has params (optional start, with angle brackets) and parts with optional cid values such as " <img@x> ". Content ids are compared after trimming spaces and angle brackets. The root is the part whose id equals the start id, else the first part. Each reference is a URL; the "cid:" scheme is case-insensitive and the rest is percent-decoded. A reference resolves to the first non-root part with an equal id, else None. Result {root, resolved [[ref, index]...], unused: non-root indexes nobody referenced}.
Why this case matters
Inline images and style sheets in HTML mail are located through Content-ID references.
One recorded failure
Sample boundary fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| scheme casing | {"resolved": [["CID:pic@x", null], ["Cid:pic@x", null], ["http://pic@x", null]], "root": 0, "unused": [1]} | {"resolved": [["CID:pic@x", 1], ["Cid:pic@x", 1], ["http://pic@x", null]], "root": 0, "unused": []} | 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 ↗