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:
parent
345518253a
commit
bf7a89fef7
1 changed files with 1 additions and 1 deletions
|
@ -37,7 +37,7 @@ impl ImageDownloader {
|
||||||
let response = client.get(url).send().await?;
|
let response = client.get(url).send().await?;
|
||||||
|
|
||||||
let content_type = Util::get_content_type(&response)?;
|
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") {
|
if !content_type.contains("image") {
|
||||||
return Err(ImageDownloadError::ContentType);
|
return Err(ImageDownloadError::ContentType);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue