Marmot-TS
    Preparing search index...

    Function canonicalizeMimeType

    • Canonicalizes a MIME type for use in encrypted-media-v2 cryptographic operations (key derivation and AEAD AAD).

      Sender and receiver MUST apply this identical algorithm (features/encrypted-media.md — Media Type Canonicalization):

      1. take the substring before the first ;, dropping any parameters
      2. trim leading/trailing HTAB, LF, FF, CR and space (not vertical tab)
      3. lowercase using ASCII case folding only
      4. require exactly two HTTP-token segments of 1..64 bytes, total ≤128 bytes
      5. apply the canonical alias image/jpg → image/jpeg

      Adding an alias or normalization step is a breaking media-version change.

      Parameters

      • mimeType: string

        The raw MIME type string

      Returns string

      The canonical MIME type

      If the canonical result violates the v2 MIME profile