This commit is contained in:
Kitaiti Makoto 2023-01-05 04:14:25 +09:00
parent 699fdc30d9
commit 3580fb04fa
2 changed files with 17 additions and 7 deletions

View File

@ -18,11 +18,14 @@ use openssl::{
rsa::Rsa,
sign::{Signer, Verifier},
};
use plume_common::{activity_pub::{
inbox::{AsActor, FromId},
sign, ActivityStream, ApSignature, CustomGroup, Id, IntoId, PublicKey, Source, SourceProperty,
ToAsString, ToAsUri,
}, utils::iri_percent_encode_seg};
use plume_common::{
activity_pub::{
inbox::{AsActor, FromId},
sign, ActivityStream, ApSignature, CustomGroup, Id, IntoId, PublicKey, Source,
SourceProperty, ToAsString, ToAsUri,
},
utils::iri_percent_encode_seg,
};
use webfinger::*;
#[derive(Queryable, Identifiable, Clone, AsChangeset, Debug)]
@ -85,7 +88,11 @@ impl Blog {
if instance.local {
inserted.fqn = iri_percent_encode_seg(&inserted.actor_id.clone());
} else {
inserted.fqn = format!("{}@{}", iri_percent_encode_seg(&inserted.actor_id), instance.public_domain);
inserted.fqn = format!(
"{}@{}",
iri_percent_encode_seg(&inserted.actor_id),
instance.public_domain
);
}
}

View File

@ -937,7 +937,10 @@ impl FromId<DbConn> for User {
.to_string();
if username.contains(&['<', '>', '&', '@', '\'', '"', ' ', '\t'][..]) {
tracing::error!("preferredUsername includes invalid character(s): {}", &username);
tracing::error!(
"preferredUsername includes invalid character(s): {}",
&username
);
return Err(Error::InvalidValue);
}