From 1731bcb1c6a9752ad7e965d6187fa7f2019ee1b3 Mon Sep 17 00:00:00 2001 From: alemi Date: Tue, 23 Apr 2024 05:30:10 +0200 Subject: [PATCH] fix: remove again trailing slash --- src/routes/activitypub/application.rs | 2 +- src/server/context.rs | 2 +- src/server/dispatcher.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/routes/activitypub/application.rs b/src/routes/activitypub/application.rs index 90de4dc..451885a 100644 --- a/src/routes/activitypub/application.rs +++ b/src/routes/activitypub/application.rs @@ -31,7 +31,7 @@ pub async fn view( .set_preferred_username(Some(ctx.domain())) .set_public_key(apb::Node::object( serde_json::Value::new_object() - .set_id(Some(&url!(ctx, "/#main-key"))) + .set_id(Some(&url!(ctx, "#main-key"))) .set_owner(Some(&url!(ctx, ""))) .set_public_key_pem(&ctx.app().public_key) )) diff --git a/src/server/context.rs b/src/server/context.rs index aae2a6a..112f59b 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 { diff --git a/src/server/dispatcher.rs b/src/server/dispatcher.rs index be80f16..e7d22d9 100644 --- a/src/server/dispatcher.rs +++ b/src/server/dispatcher.rs @@ -92,7 +92,7 @@ async fn worker(db: DatabaseConnection, domain: String, poll_interval: u64, mut }, }; - let key = if delivery.actor == format!("https://{domain}/") { + let key = if delivery.actor == format!("https://{domain}") { let Some(model::application::Model { private_key: key, .. }) = model::application::Entity::find() .one(&db).await? else {