From 2ec0ad6068a9565d91478f18c0ff5dd41a8cc5fd Mon Sep 17 00:00:00 2001 From: Natty Date: Sat, 22 Apr 2023 02:21:02 +0200 Subject: [PATCH] NodeInfo href fixes --- src/nodeinfo.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/nodeinfo.rs b/src/nodeinfo.rs index f7fcb79..5bac7e4 100644 --- a/src/nodeinfo.rs +++ b/src/nodeinfo.rs @@ -16,7 +16,7 @@ const NODEINFO_PATH: &str = "/nodeinfo"; #[derive(Clone, Debug, Serialize)] pub struct NodeInfoLink { rel: &'static str, - href: &'static str, + href: String, } pub async fn handle_nodeinfo( @@ -24,11 +24,17 @@ pub async fn handle_nodeinfo( ) -> Json> { Json(vec![ NodeInfoLink { - href: "/nodeinfo/2.0", + href: format!( + "{}://{}/nodeinfo/2.0", + config.networking.protocol, config.networking.host + ), rel: RelNodeInfo20.rel(), }, NodeInfoLink { - href: "/nodeinfo/2.1", + href: format!( + "{}://{}/nodeinfo/2.1", + config.networking.protocol, config.networking.host + ), rel: RelNodeInfo21.rel(), }, ])