This commit is contained in:
Astro 2023-05-14 23:29:36 +02:00
parent 01f8cc2f5f
commit f7f632a971
2 changed files with 2 additions and 2 deletions

View file

@ -109,7 +109,7 @@ impl<'a> Endpoint<'a> {
private_key: &PrivateKey, private_key: &PrivateKey,
) -> Result<Actor, Error> { ) -> Result<Actor, Error> {
let remote_actor: Actor = serde_json::from_value( let remote_actor: Actor = serde_json::from_value(
authorized_fetch(&client, &self.remote_actor_uri, key_id, private_key).await? authorized_fetch(client, &self.remote_actor_uri, key_id, private_key).await?
)?; )?;
let public_key = PublicKey::from_pem(remote_actor.public_key.pem.as_bytes())?; let public_key = PublicKey::from_pem(remote_actor.public_key.pem.as_bytes())?;
if ! (self.signature.verify(&public_key)?) { if ! (self.signature.verify(&public_key)?) {

View file

@ -34,6 +34,6 @@ where
if res.status() >= StatusCode::OK && res.status() < StatusCode::MULTIPLE_CHOICES { if res.status() >= StatusCode::OK && res.status() < StatusCode::MULTIPLE_CHOICES {
Ok(res.json().await?) Ok(res.json().await?)
} else { } else {
Err(Error::Response(format!("{}", res.text().await?))) Err(Error::Response(res.text().await?))
} }
} }