fix: not all keys are #main-key

This commit is contained in:
əlemi 2024-04-16 19:19:49 +02:00
parent 1b29f1d915
commit 267840a317
Signed by: alemi
GPG key ID: A4895B84D311642C

View file

@ -70,7 +70,10 @@ where
let mut http_signature = HttpSignature::parse(sig); let mut http_signature = HttpSignature::parse(sig);
// TODO assert payload's digest is equal to signature's // TODO assert payload's digest is equal to signature's
let user_id = http_signature.key_id.replace("#main-key", ""); let user_id = http_signature.key_id
.split('#')
.next().ok_or(UpubError::bad_request())?
.to_string();
match ctx.fetch().user(&user_id).await { match ctx.fetch().user(&user_id).await {
Ok(user) => match http_signature Ok(user) => match http_signature