From e5c305b9028752b4c98203f3f352c9496c161285 Mon Sep 17 00:00:00 2001 From: Sven-Hendrik Haase Date: Sun, 18 Apr 2021 07:34:48 +0200 Subject: [PATCH] Add zip and gzip MIMEs As defined in http://www.iana.org/assignments/media-types/media-types.xhtml --- mime-parse/src/constants.rs | 10 ++++++++++ src/constants.rs | 2 ++ 2 files changed, 12 insertions(+) diff --git a/mime-parse/src/constants.rs b/mime-parse/src/constants.rs index 634c2bf3..cad94035 100644 --- a/mime-parse/src/constants.rs +++ b/mime-parse/src/constants.rs @@ -305,11 +305,17 @@ impl Atoms { if sub == PDF { return Atoms::APPLICATION_PDF; } + if sub == ZIP { + return Atoms::APPLICATION_ZIP; + } } 4 => { if sub == JSON { return Atoms::APPLICATION_JSON; } + if sub == GZIP { + return Atoms::APPLICATION_GZIP; + } }, 7 => { if sub == MSGPACK { @@ -406,6 +412,8 @@ names! { MSGPACK, "msgpack"; OCTET_STREAM, "octet-stream"; PDF, "pdf"; + ZIP, "zip"; + GZIP, "gzip"; // common font/* WOFF, "woff"; @@ -466,6 +474,8 @@ mimes! { APPLICATION_MSGPACK, "application/msgpack", 11; APPLICATION_PDF, "application/pdf", 11; APPLICATION_DNS, "application/dns-message", 11; + APPLICATION_ZIP, "application/zip", 11; + APPLICATION_GZIP, "application/gzip", 11; // media-ranges //@ MediaRange: diff --git a/src/constants.rs b/src/constants.rs index af4376ec..498fa8e7 100644 --- a/src/constants.rs +++ b/src/constants.rs @@ -109,6 +109,8 @@ mimes! { APPLICATION_MSGPACK, "application/msgpack"; APPLICATION_PDF, "application/pdf"; APPLICATION_DNS, "application/dns-message"; + APPLICATION_ZIP, "application/zip"; + APPLICATION_GZIP, "application/gzip"; // media-ranges @ MediaRange: