From 1f7a1978b9f97d44d1b2dc480d6d7e1239d673be Mon Sep 17 00:00:00 2001 From: Valentin Brandl Date: Fri, 9 Aug 2019 23:10:31 +0200 Subject: [PATCH] Replace deprecated function --- backend/src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/src/main.rs b/backend/src/main.rs index d8f4f4e..4358d6b 100644 --- a/backend/src/main.rs +++ b/backend/src/main.rs @@ -48,7 +48,7 @@ fn proxy_file( .from_err() .and_then(move |response| match response.status() { StatusCode::OK => { - let mime = mime_guess::guess_mime_type(&*data.file); + let mime = mime_guess::from_path(&*data.file).first_or_octet_stream(); Ok(HttpResponse::Ok() .content_type(mime.to_string().as_str()) .set(CacheControl(vec![ @@ -127,7 +127,7 @@ fn serve_gist( .from_err() .and_then(move |response| match response.status() { StatusCode::OK => { - let mime = mime_guess::guess_mime_type(&*data.file); + let mime = mime_guess::from_path(&*data.file).first_or_octet_stream(); Ok(HttpResponse::Ok() .content_type(mime.to_string().as_str()) .set(CacheControl(vec![