diff options
Diffstat (limited to 'src/database')
-rw-r--r-- | src/database/file/mod.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/database/file/mod.rs b/src/database/file/mod.rs index 6cbe3c6..da8a06a 100644 --- a/src/database/file/mod.rs +++ b/src/database/file/mod.rs @@ -97,9 +97,9 @@ fn url_to_path(root: &Path, url: &str) -> PathBuf { } fn url_to_relative_path(url: &str) -> relative_path::RelativePathBuf { - let url = http_types::Url::parse(url).expect("Couldn't parse a URL"); + let url = warp::http::Uri::try_from(url).expect("Couldn't parse a URL"); let mut path = relative_path::RelativePathBuf::new(); - path.push(url.origin().ascii_serialization() + &url.path().to_string() + ".json"); + path.push(url.authority().unwrap().to_string() + &url.path().to_string() + ".json"); path } @@ -375,7 +375,7 @@ impl Storage for FileStorage { println!("Adding to channel list..."); // Add the h-feed to the channel list let mut path = relative_path::RelativePathBuf::new(); - path.push(user); + path.push(warp::http::Uri::try_from(user.to_string()).unwrap().authority().unwrap().to_string()); path.push("channels"); let path = path.to_path(&self.root_dir); @@ -456,7 +456,7 @@ impl Storage for FileStorage { async fn get_channels<'a>(&self, user: &'a str) -> Result<Vec<super::MicropubChannel>> { let mut path = relative_path::RelativePathBuf::new(); - path.push(user.to_string()); + path.push(warp::http::Uri::try_from(user.to_string()).unwrap().authority().unwrap().to_string()); path.push("channels"); let path = path.to_path(&self.root_dir); |