From 8150b9082d7f7e3562bd7ce1c03698050201f3fe Mon Sep 17 00:00:00 2001 From: alemi Date: Tue, 23 Apr 2024 04:56:29 +0200 Subject: [PATCH] fix: proper addressing, ctx.base() with trailing / maybe aode-relay (and rust IRI parser) goes mad if there's no trailing slash? idk, i'm speculating --- src/main.rs | 6 +++--- src/server/context.rs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main.rs b/src/main.rs index f87a6ee2..9b3f1228 100644 --- a/src/main.rs +++ b/src/main.rs @@ -117,10 +117,10 @@ async fn main() { object: Some(actor.clone()), target: None, published: chrono::Utc::now(), - cc: model::Audience::default(), - bcc: model::Audience::default(), - to: model::Audience::default(), + to: model::Audience(vec![actor.clone()]), bto: model::Audience::default(), + cc: model::Audience(vec![apb::target::PUBLIC.to_string()]), + bcc: model::Audience::default(), }; model::activity::Entity::insert(activity_model.into_active_model()) .exec(ctx.db()).await.expect("could not insert activity in db"); diff --git a/src/server/context.rs b/src/server/context.rs index 112f59b4..aae2a6a1 100644 --- a/src/server/context.rs +++ b/src/server/context.rs @@ -84,7 +84,7 @@ impl Context { } pub fn base(&self) -> String { - format!("{}{}", self.0.protocol, self.0.domain) + format!("{}{}/", self.0.protocol, self.0.domain) } pub fn uri(&self, entity: &str, id: String) -> String {