mirror of
https://github.com/vbrandl/bind9-api.git
synced 2024-12-04 09:41:54 +01:00
Fix breaking change in ToHex
crate
This commit is contained in:
parent
a31c30a3b0
commit
55aa95a41c
@ -106,7 +106,7 @@ fn call_api<D: serde::Serialize>(
|
|||||||
let data_s = serde_json::to_string(&data)?;
|
let data_s = serde_json::to_string(&data)?;
|
||||||
info!("body: {}", data_s);
|
info!("body: {}", data_s);
|
||||||
let signature = crypto::sign(config.secret.as_bytes(), data_s.as_bytes());
|
let signature = crypto::sign(config.secret.as_bytes(), data_s.as_bytes());
|
||||||
let signature = crypto::bytes_to_hex_str(&signature)?;
|
let signature = crypto::bytes_to_hex_str(&signature);
|
||||||
let client = reqwest::Client::new();
|
let client = reqwest::Client::new();
|
||||||
let url = format!("{}/record", config.host);
|
let url = format!("{}/record", config.host);
|
||||||
Ok(if method == Method::POST {
|
Ok(if method == Method::POST {
|
||||||
|
@ -55,10 +55,8 @@ use ring::{digest, hmac};
|
|||||||
type Result<T> = std::result::Result<T, Error>;
|
type Result<T> = std::result::Result<T, Error>;
|
||||||
|
|
||||||
/// Converts a byte slice to a lowercase hex string.
|
/// Converts a byte slice to a lowercase hex string.
|
||||||
pub fn bytes_to_hex_str(bytes: &[u8]) -> Result<String> {
|
pub fn bytes_to_hex_str(bytes: &[u8]) -> String {
|
||||||
let mut output = String::new();
|
bytes.encode_hex::<String>()
|
||||||
bytes.write_hex(&mut output)?;
|
|
||||||
Ok(output)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Converts a hey string to a vec of bytes.
|
/// Converts a hey string to a vec of bytes.
|
||||||
|
Loading…
Reference in New Issue
Block a user