1
0
Fork 0
forked from alemi/upub

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
This commit is contained in:
əlemi 2024-04-23 04:56:29 +02:00
parent 63d78e7ff5
commit 8150b9082d
Signed by: alemi
GPG key ID: A4895B84D311642C
2 changed files with 4 additions and 4 deletions

View file

@ -117,10 +117,10 @@ async fn main() {
object: Some(actor.clone()), object: Some(actor.clone()),
target: None, target: None,
published: chrono::Utc::now(), published: chrono::Utc::now(),
cc: model::Audience::default(), to: model::Audience(vec![actor.clone()]),
bcc: model::Audience::default(),
to: model::Audience::default(),
bto: model::Audience::default(), 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()) model::activity::Entity::insert(activity_model.into_active_model())
.exec(ctx.db()).await.expect("could not insert activity in db"); .exec(ctx.db()).await.expect("could not insert activity in db");

View file

@ -84,7 +84,7 @@ impl Context {
} }
pub fn base(&self) -> String { 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 { pub fn uri(&self, entity: &str, id: String) -> String {