Marmot-TS
    Preparing search index...

    Function canonicalizeMimeType

    • Canonicalizes a MIME type for use in encrypted-media-v1 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 and trailing ASCII whitespace
      3. lowercase using ASCII case folding only
      4. reject if the result is empty or does not contain /
      5. apply the canonical alias image/jpgimage/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 is empty or has no /