From 270908b38c3bd6883f44073052eb87b3931f9003 Mon Sep 17 00:00:00 2001 From: alemi Date: Sat, 7 Dec 2024 01:46:49 +0100 Subject: [PATCH] fix(apb): forgot to check inside feature flag --- Cargo.lock | 2 +- apb/Cargo.toml | 2 +- apb/src/node.rs | 18 ++++++++++-------- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9e7279a..559571b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -140,7 +140,7 @@ checksum = "d301b3b94cb4b2f23d7917810addbbaff90738e0ca2be692bd027e70d7e0330c" [[package]] name = "apb" -version = "0.3.0" +version = "0.3.1" dependencies = [ "chrono", "paste", diff --git a/apb/Cargo.toml b/apb/Cargo.toml index e8216be..bda1c39 100644 --- a/apb/Cargo.toml +++ b/apb/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "apb" -version = "0.3.0" +version = "0.3.1" edition = "2021" authors = [ "alemi " ] description = "Traits and types to handle ActivityPub objects" diff --git a/apb/src/node.rs b/apb/src/node.rs index 9d23bfb..e897bf6 100644 --- a/apb/src/node.rs +++ b/apb/src/node.rs @@ -208,14 +208,16 @@ impl Node { #[cfg(feature = "fetch")] pub async fn fetch(&mut self) -> reqwest::Result<&mut Self> { if let Node::Link(link) = self { - *self = reqwest::Client::new() - .get(link.href()) - .header("Accept", "application/json") - .send() - .await? - .json::() - .await? - .into(); + if let Ok(url) = link.href() { + *self = reqwest::Client::new() + .get(url) + .header("Accept", "application/json") + .send() + .await? + .json::() + .await? + .into(); + } } Ok(self) }