1
0
Fork 0
mirror of https://gitlab.com/news-flash/article_scraper.git synced 2025-07-07 08:05:31 +02:00

don't fail because of lacking content length

This commit is contained in:
Jan Lukas Gernert 2023-07-23 15:39:24 +02:00
parent 345518253a
commit bf7a89fef7

View file

@ -37,7 +37,7 @@ impl ImageDownloader {
let response = client.get(url).send().await?;
let content_type = Util::get_content_type(&response)?;
let content_length = Util::get_content_length(&response)?;
let content_length = Util::get_content_length(&response).unwrap_or(0);
if !content_type.contains("image") {
return Err(ImageDownloadError::ContentType);