From 8c949c9909e1e2941fc193c4d50742ff2b1840b9 Mon Sep 17 00:00:00 2001 From: est31 Date: Thu, 15 Oct 2020 14:43:55 +0200 Subject: [PATCH] Add webp Mime type Fixes #123 --- mime-parse/src/constants.rs | 5 +++++ src/constants.rs | 1 + 2 files changed, 6 insertions(+) diff --git a/mime-parse/src/constants.rs b/mime-parse/src/constants.rs index 634c2bf3..6fe73857 100644 --- a/mime-parse/src/constants.rs +++ b/mime-parse/src/constants.rs @@ -269,6 +269,9 @@ impl Atoms { if sub == JPEG { return Atoms::IMAGE_JPEG; } + if sub == WEBP { + return Atoms::IMAGE_WEBP; + } }, 7 => { if sub == SVG { @@ -418,6 +421,7 @@ names! { BMP, "bmp"; GIF, "gif"; JPEG, "jpeg"; + WEBP, "webp"; PNG, "png"; SVG, "svg+xml"; @@ -453,6 +457,7 @@ mimes! { IMAGE_GIF, "image/gif", 5; IMAGE_PNG, "image/png", 5; IMAGE_BMP, "image/bmp", 5; + IMAGE_WEBP, "image/webp", 5; IMAGE_SVG, "image/svg+xml", 5, Some(9); FONT_WOFF, "font/woff", 4; diff --git a/src/constants.rs b/src/constants.rs index af4376ec..57db0d3e 100644 --- a/src/constants.rs +++ b/src/constants.rs @@ -96,6 +96,7 @@ mimes! { IMAGE_GIF, "image/gif"; IMAGE_PNG, "image/png"; IMAGE_BMP, "image/bmp"; + IMAGE_WEBP, "image/webp"; IMAGE_SVG, "image/svg+xml"; FONT_WOFF, "font/woff";