mirror of
https://codeberg.org/Mo8it/git-webhook-client
synced 2024-11-21 11:06:32 +00:00
Remove unneeded async
This commit is contained in:
parent
1f3046c4d3
commit
46ad6275ba
1 changed files with 2 additions and 5 deletions
|
@ -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());
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue