Skip to content

Commit

Permalink
fix(web): Early return on no content type
Browse files Browse the repository at this point in the history
  • Loading branch information
mmstick committed Mar 30, 2022
1 parent b62d78c commit bc56e49
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions plugins/src/web/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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!(
Expand Down

0 comments on commit bc56e49

Please sign in to comment.