From afa875366ecc866d370be8b6eb5eeaa0818b5367 Mon Sep 17 00:00:00 2001 From: Kitaiti Makoto Date: Wed, 4 Jan 2023 18:54:38 +0900 Subject: [PATCH] Percent encode to create ActivityPub URI --- plume-models/src/instance.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plume-models/src/instance.rs b/plume-models/src/instance.rs index 5400a126..5f8e09af 100644 --- a/plume-models/src/instance.rs +++ b/plume-models/src/instance.rs @@ -9,7 +9,7 @@ use crate::{ use chrono::NaiveDateTime; use diesel::{self, result::Error::NotFound, ExpressionMethods, QueryDsl, RunQueryDsl}; use once_cell::sync::OnceCell; -use plume_common::utils::md_to_html; +use plume_common::utils::{md_to_html, iri_percent_encode_seg}; use std::sync::RwLock; #[derive(Clone, Identifiable, Queryable)] @@ -173,8 +173,8 @@ impl Instance { "{instance}/{prefix}/{name}/{box_name}", instance = self.public_domain, prefix = prefix, - name = name, - box_name = box_name + name = iri_percent_encode_seg(name), + box_name = iri_percent_encode_seg(box_name) )) }