fix(web): Early return on no content type

This commit is contained in:
Michael Aaron Murphy 2022-03-30 17:29:14 +02:00 committed by Michael Murphy
parent b62d78cc15
commit bc56e493db

View file

@ -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!(