NodeInfo href fixes

This commit is contained in:
Natty 2023-04-22 02:21:02 +02:00
parent 3826b9fc2f
commit 2ec0ad6068
Signed by: natty
GPG Key ID: BF6CB659ADEE60EC
1 changed files with 9 additions and 3 deletions

View File

@ -16,7 +16,7 @@ const NODEINFO_PATH: &str = "/nodeinfo";
#[derive(Clone, Debug, Serialize)] #[derive(Clone, Debug, Serialize)]
pub struct NodeInfoLink { pub struct NodeInfoLink {
rel: &'static str, rel: &'static str,
href: &'static str, href: String,
} }
pub async fn handle_nodeinfo( pub async fn handle_nodeinfo(
@ -24,11 +24,17 @@ pub async fn handle_nodeinfo(
) -> Json<Vec<NodeInfoLink>> { ) -> Json<Vec<NodeInfoLink>> {
Json(vec![ Json(vec![
NodeInfoLink { NodeInfoLink {
href: "/nodeinfo/2.0", href: format!(
"{}://{}/nodeinfo/2.0",
config.networking.protocol, config.networking.host
),
rel: RelNodeInfo20.rel(), rel: RelNodeInfo20.rel(),
}, },
NodeInfoLink { NodeInfoLink {
href: "/nodeinfo/2.1", href: format!(
"{}://{}/nodeinfo/2.1",
config.networking.protocol, config.networking.host
),
rel: RelNodeInfo21.rel(), rel: RelNodeInfo21.rel(),
}, },
]) ])