From bc56e493db331244d39dc84c30b37b460e79daef Mon Sep 17 00:00:00 2001 From: Michael Aaron Murphy Date: Wed, 30 Mar 2022 17:29:14 +0200 Subject: [PATCH] fix(web): Early return on no content type --- plugins/src/web/mod.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/plugins/src/web/mod.rs b/plugins/src/web/mod.rs index 92e8161..1ce2cc7 100644 --- a/plugins/src/web/mod.rs +++ b/plugins/src/web/mod.rs @@ -209,8 +209,7 @@ async fn fetch_favicon(url: &str, favicon_path: &Path, client: &Client) -> Optio let content_type = response .headers() .get(reqwest::header::CONTENT_TYPE) - .and_then(|header| header.to_str().ok()) - .unwrap(); + .and_then(|header| header.to_str().ok())?; if !ALLOWED_FAVICON_MIME.contains(&content_type) { tracing::error!(