Skip to content

validateMediaType

validateMediaType(mediaType): boolean

Defined in: astrobase/src/media-types/media-types.ts:61

Validates media type ASCII bytes (minus the NUL terminator byte). Valid media types use only alphanumeric characters and dashes, with one forward slash separator, and cannot be longer than 127 characters.

Uint8Array

The media type ASCII bytes.

boolean

true if the media type is valid. false otherwise.