From 35829239b677d32c929197c7136c8c3f3f0e10a8 Mon Sep 17 00:00:00 2001 From: Denis Cornehl Date: Sat, 11 Feb 2023 17:23:42 +0100 Subject: [PATCH] don't report error on unknown mime type from S3 --- src/web/file.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/web/file.rs b/src/web/file.rs index 75426c5e2..34641c97b 100644 --- a/src/web/file.rs +++ b/src/web/file.rs @@ -4,10 +4,9 @@ use super::cache::CachePolicy; use crate::{ error::Result, storage::{Blob, Storage}, - utils::report_error, Config, }; -use anyhow::anyhow; + use axum::{ extract::Extension, http::{ @@ -36,10 +35,11 @@ impl File { impl IntoResponse for File { fn into_response(self) -> AxumResponse { - let content_type: Mime = self.0.mime.parse::().unwrap_or_else(|e| { - report_error(&anyhow!(e).context("could not parse mime from storage object")); - mime::APPLICATION_OCTET_STREAM - }); + let content_type: Mime = self + .0 + .mime + .parse::() + .unwrap_or(mime::APPLICATION_OCTET_STREAM); ( StatusCode::OK,