Fix a but about blog title and AP URL

This commit is contained in:
Kitaiti Makoto 2023-01-03 22:09:13 +09:00
parent d20ce6dd0b
commit ee1e553460
2 changed files with 9 additions and 6 deletions

View File

@ -18,10 +18,13 @@ use openssl::{
rsa::Rsa, rsa::Rsa,
sign::{Signer, Verifier}, sign::{Signer, Verifier},
}; };
use plume_common::activity_pub::{ use plume_common::{
activity_pub::{
inbox::{AsActor, FromId}, inbox::{AsActor, FromId},
sign, ActivityStream, ApSignature, CustomGroup, Id, IntoId, PublicKey, Source, SourceProperty, sign, ActivityStream, ApSignature, CustomGroup, Id, IntoId, PublicKey, Source,
ToAsString, ToAsUri, SourceProperty, ToAsString, ToAsUri,
},
utils::iri_percent_encode_seg,
}; };
use webfinger::*; use webfinger::*;
@ -450,7 +453,7 @@ impl FromId<DbConn> for Blog {
let any_base = AnyBase::from_extended(object)?; let any_base = AnyBase::from_extended(object)?;
let id = any_base.id().ok_or(Error::MissingApProperty)?; let id = any_base.id().ok_or(Error::MissingApProperty)?;
new_blog.ap_url = id.to_string(); new_blog.ap_url = iri_percent_encode_seg(id.as_ref());
let inst = id let inst = id
.authority_components() .authority_components()

View File

@ -255,7 +255,7 @@ impl Post {
ap_url(&format!( ap_url(&format!(
"{}/~/{}/{}/", "{}/~/{}/{}/",
CONFIG.base_url, CONFIG.base_url,
blog.fqn, iri_percent_encode_seg(&blog.fqn),
iri_percent_encode_seg(slug) iri_percent_encode_seg(slug)
)) ))
} }