|
@ -352,10 +352,12 @@ fn get_favicons_node(node: &std::rc::Rc<markup5ever_rcdom::Node>, icons: &mut Ve |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if has_rel && href.is_some() { |
|
|
if has_rel { |
|
|
if let Ok(full_href) = url.join(&href.unwrap()).map(|h| h.into_string()) { |
|
|
if let Some(inner_href) = href { |
|
|
let priority = get_icon_priority(&full_href, sizes); |
|
|
if let Ok(full_href) = url.join(&inner_href).map(|h| h.into_string()) { |
|
|
icons.push(Icon::new(priority, full_href)); |
|
|
let priority = get_icon_priority(&full_href, sizes); |
|
|
|
|
|
icons.push(Icon::new(priority, full_href)); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -472,7 +474,7 @@ fn get_icon_url(domain: &str) -> Result<IconUrlResult, Error> { |
|
|
let dom = html5ever::parse_document(markup5ever_rcdom::RcDom::default(), Default::default()) |
|
|
let dom = html5ever::parse_document(markup5ever_rcdom::RcDom::default(), Default::default()) |
|
|
.from_utf8() |
|
|
.from_utf8() |
|
|
.read_from(&mut limited_reader)?; |
|
|
.read_from(&mut limited_reader)?; |
|
|
|
|
|
|
|
|
get_favicons_node(&dom.document, &mut iconlist, &url); |
|
|
get_favicons_node(&dom.document, &mut iconlist, &url); |
|
|
} else { |
|
|
} else { |
|
|
// Add the default favicon.ico to the list with just the given domain
|
|
|
// Add the default favicon.ico to the list with just the given domain
|
|
|