From 9994b4f498bbda580e9ec16336fdcc5fe3b755a4 Mon Sep 17 00:00:00 2001 From: mitsubosh Date: Mon, 28 Aug 2023 22:04:35 +0900 Subject: [PATCH] Add audio media types follow up: https://github.com/hyperium/mime/pull/44 ref: https://github.com/hyperium/mime/issues/130 --- mime-parse/src/constants.rs | 24 +++++++++++++++++++++++- src/constants.rs | 6 +++++- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/mime-parse/src/constants.rs b/mime-parse/src/constants.rs index 634c2bf..a2a701b 100644 --- a/mime-parse/src/constants.rs +++ b/mime-parse/src/constants.rs @@ -294,6 +294,24 @@ impl Atoms { return Atoms::AUDIO_STAR; } }, + 3 => { + if sub == OGG { + return Atoms::AUDIO_OGG; + } + if sub == MP4 { + return Atoms::AUDIO_MP4; + } + } + 4 => { + if sub == MPEG { + return Atoms::AUDIO_MPEG; + } + }, + 5 => { + if sub == BASIC { + return Atoms::AUDIO_BASIC; + } + }, _ => (), } } @@ -467,6 +485,11 @@ mimes! { APPLICATION_PDF, "application/pdf", 11; APPLICATION_DNS, "application/dns-message", 11; + AUDIO_BASIC, "audio/basic", 5; + AUDIO_MPEG, "audio/mpeg", 5; + AUDIO_MP4, "audio/mp4", 5; + AUDIO_OGG, "audio/ogg", 5; + // media-ranges //@ MediaRange: STAR_STAR, "*/*", 1; @@ -475,4 +498,3 @@ mimes! { VIDEO_STAR, "video/*", 5; AUDIO_STAR, "audio/*", 5; } - diff --git a/src/constants.rs b/src/constants.rs index af4376e..1100d26 100644 --- a/src/constants.rs +++ b/src/constants.rs @@ -110,6 +110,11 @@ mimes! { APPLICATION_PDF, "application/pdf"; APPLICATION_DNS, "application/dns-message"; + AUDIO_BASIC, "audio/basic"; + AUDIO_MPEG, "audio/mpeg"; + AUDIO_MP4, "audio/mp4"; + AUDIO_OGG, "audio/ogg"; + // media-ranges @ MediaRange: STAR_STAR, "*/*"; @@ -118,4 +123,3 @@ mimes! { VIDEO_STAR, "video/*"; AUDIO_STAR, "audio/*"; } -