diff --git a/src/fetch/mod.rs b/src/fetch/mod.rs index 67165a9..f078cf6 100644 --- a/src/fetch/mod.rs +++ b/src/fetch/mod.rs @@ -65,9 +65,9 @@ pub async fn fetch_object_http( let content_type = res .content_type .as_ref() - .and_then(|c| c.to_str().ok()) + .and_then(|c| Some(c.to_str().ok()?.to_lowercase())) .ok_or(Error::FetchInvalidContentType(res.url.clone()))?; - if !VALID_RESPONSE_CONTENT_TYPES.contains(&content_type) { + if !VALID_RESPONSE_CONTENT_TYPES.contains(&content_type.as_str()) { return Err(Error::FetchInvalidContentType(res.url)); }