about summary refs log tree commit diff
path: root/web/converse/src/handlers.rs
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2021-04-05T18·30+0200
committertazjin <mail@tazj.in>2021-04-05T19·19+0000
commita87533695f3bede9c50476008c0513bea234c18b (patch)
treeb21d5ee976783d549f6f7d889b4db99e98db46da /web/converse/src/handlers.rs
parent3b0b21f8d155075e81043316434ac37a0cadd7fc (diff)
fix(web/converse): Update to use mime_guess::from_path r/2446
... instead of its deprecated predecessor.

Change-Id: I8af286c6b1ee7c25c153f1209d094ae4f5eb53cc
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2860
Tested-by: BuildkiteCI
Reviewed-by: tazjin <mail@tazj.in>
Diffstat (limited to 'web/converse/src/handlers.rs')
-rw-r--r--web/converse/src/handlers.rs3
1 files changed, 1 insertions, 2 deletions
diff --git a/web/converse/src/handlers.rs b/web/converse/src/handlers.rs
index d984fc71374b..c4448c748365 100644
--- a/web/converse/src/handlers.rs
+++ b/web/converse/src/handlers.rs
@@ -32,7 +32,6 @@ use actix_web;
 use crate::db::*;
 use crate::errors::ConverseError;
 use futures::Future;
-use mime_guess::guess_mime_type;
 use crate::models::*;
 use crate::oidc::*;
 use crate::render::*;
@@ -316,7 +315,7 @@ pub trait EmbeddedFile {
 impl EmbeddedFile for App<AppState> {
     fn static_file(self, path: &'static str, content: &'static [u8]) -> Self {
         self.route(path, Method::GET, move |_: HttpRequest<_>| {
-            let mime = format!("{}", guess_mime_type(path));
+            let mime = format!("{}", mime_guess::from_path(path).first_or_octet_stream());
             HttpResponse::Ok()
                 .content_type(mime.as_str())
                 .body(content)