handle urls with single or double dot host
@@ -208,9 +208,11 @@ fn xh_version() -> String {
fn path_from_url(url: &Url) -> Result<String> {
match (url.host_str(), url.port()) {
+ (Some("."), _) | (Some(".."), _) | (None, _) => {
+ Err(anyhow!("couldn't extract host from url"))
+ }
(Some(host), Some(port)) => Ok(format!("{}_{}", host, port)),
(Some(host), None) => Ok(host.into()),
- (None, _) => Err(anyhow!("couldn't extract host from url")),
}
}
