1
0
Fork 0
mirror of https://codeberg.org/Mo8it/git-webhook-client synced 2024-11-23 11:11:36 +00:00

Remove unneeded async

This commit is contained in:
Mo 2022-12-30 14:54:14 +01:00
parent 1f3046c4d3
commit 46ad6275ba

View file

@ -37,7 +37,7 @@ where
}
impl ReceivedSignature {
pub async fn is_valid(&self, secret: &[u8], body: &[u8]) -> bool {
pub fn is_valid(&self, secret: &[u8], body: &[u8]) -> bool {
let mut mac = Hmac::<Sha256>::new_from_slice(secret)
.expect("Can not generate a mac from the secret!");
mac.update(body);
@ -69,10 +69,7 @@ where
let state_config = state.config();
if !received_signature
.is_valid(&state_config.secret, &body)
.await
{
if !received_signature.is_valid(&state_config.secret, &body) {
return Err("Invalid signature!".into());
}