cave/feed: report url_host() errors

This commit is contained in:
Astro 2023-08-01 21:52:45 +02:00
parent b0d63aad28
commit 221c4a7fb2
1 changed files with 1 additions and 0 deletions

View File

@ -5,6 +5,7 @@ use eventsource_stream::Eventsource;
pub fn url_host(url: &str) -> Option<String> {
reqwest::Url::parse(url)
.map_err(|e| tracing::warn!("Cannot parse url {:?}: {}", url, e))
.ok()
.and_then(|url| url.domain()
.map(|host| host.to_lowercase())