mirror of
https://codeberg.org/Mo8it/git-webhook-client
synced 2024-11-21 11:06:32 +00:00
Thanks clippy
This commit is contained in:
parent
1220f6635e
commit
b33f8e5254
1 changed files with 2 additions and 2 deletions
|
@ -65,9 +65,9 @@ fn get_hook_commands(clone_url: &str) -> Option<Vec<String>> {
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
|
|
||||||
fn is_valid_signature(received_signature: &Vec<u8>, payload: &Vec<u8>) -> bool {
|
fn is_valid_signature(received_signature: &[u8], payload: &[u8]) -> bool {
|
||||||
let mut mac = Hmac::<Sha256>::new_from_slice(&get_secret()).unwrap();
|
let mut mac = Hmac::<Sha256>::new_from_slice(&get_secret()).unwrap();
|
||||||
mac.update(&payload);
|
mac.update(payload);
|
||||||
let expected_signature = mac.finalize().into_bytes();
|
let expected_signature = mac.finalize().into_bytes();
|
||||||
|
|
||||||
received_signature[..] == expected_signature[..]
|
received_signature[..] == expected_signature[..]
|
||||||
|
|
Loading…
Reference in a new issue