From e5be794c40f48a816d878d5d360fe200e8c8953b Mon Sep 17 00:00:00 2001 From: Zoran Regvart Date: Fri, 6 Nov 2020 19:15:04 +0100 Subject: [PATCH] Update src/parse.rs Co-authored-by: Joshua Nelson --- src/parse.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/parse.rs b/src/parse.rs index 751168b..d7782b4 100644 --- a/src/parse.rs +++ b/src/parse.rs @@ -37,9 +37,7 @@ fn parse_a_hrefs(handle: &Handle, base_url: &Url, urls: &mut HashSet) { .find(|attr| &attr.name.local == "href") { let mut val = attr.value.clone(); - // if the href value starts with / we need to join it to the base without the / - // otherwise with base_url = `foo`, val = `/bar`, base_url.join(val) == `/bar` - // and not `foo/bar` + // Treat absolute paths as absolute with respect to the `base_url`, not with respect to the file system. if attr.value.starts_with('/') { val.pop_front_char(); }