style: apply rustfmt after rebase

This commit is contained in:
Chummy 2026-02-19 17:52:32 +08:00
parent b1ebd4b579
commit 268a1dee09
4 changed files with 15 additions and 8 deletions

View file

@ -13,7 +13,9 @@ const QQ_AUTH_URL: &str = "https://bots.qq.com/app/getAppAccessToken";
fn ensure_https(url: &str) -> anyhow::Result<()> { fn ensure_https(url: &str) -> anyhow::Result<()> {
if !url.starts_with("https://") { if !url.starts_with("https://") {
anyhow::bail!("Refusing to transmit sensitive data over non-HTTPS URL: URL scheme must be https"); anyhow::bail!(
"Refusing to transmit sensitive data over non-HTTPS URL: URL scheme must be https"
);
} }
Ok(()) Ok(())
} }

View file

@ -10,7 +10,9 @@ use uuid::Uuid;
/// happens in the gateway when Meta sends webhook events. /// happens in the gateway when Meta sends webhook events.
fn ensure_https(url: &str) -> anyhow::Result<()> { fn ensure_https(url: &str) -> anyhow::Result<()> {
if !url.starts_with("https://") { if !url.starts_with("https://") {
anyhow::bail!("Refusing to transmit sensitive data over non-HTTPS URL: URL scheme must be https"); anyhow::bail!(
"Refusing to transmit sensitive data over non-HTTPS URL: URL scheme must be https"
);
} }
Ok(()) Ok(())
} }

View file

@ -1817,10 +1817,7 @@ mod tests {
}; };
let mut headers = HeaderMap::new(); let mut headers = HeaderMap::new();
headers.insert( headers.insert("X-Webhook-Secret", HeaderValue::from_str(&secret).unwrap());
"X-Webhook-Secret",
HeaderValue::from_str(&secret).unwrap(),
);
let response = handle_webhook( let response = handle_webhook(
State(state), State(state),
@ -1992,7 +1989,11 @@ mod tests {
// Correct prefix should pass // Correct prefix should pass
let correct_prefix = format!("sha256={hex_sig}"); let correct_prefix = format!("sha256={hex_sig}");
assert!(verify_whatsapp_signature(&app_secret, body, &correct_prefix)); assert!(verify_whatsapp_signature(
&app_secret,
body,
&correct_prefix
));
} }
#[test] #[test]

View file

@ -21,7 +21,9 @@ const COMPOSIO_API_BASE_V3: &str = "https://backend.composio.dev/api/v3";
fn ensure_https(url: &str) -> anyhow::Result<()> { fn ensure_https(url: &str) -> anyhow::Result<()> {
if !url.starts_with("https://") { if !url.starts_with("https://") {
anyhow::bail!("Refusing to transmit sensitive data over non-HTTPS URL: URL scheme must be https"); anyhow::bail!(
"Refusing to transmit sensitive data over non-HTTPS URL: URL scheme must be https"
);
} }
Ok(()) Ok(())
} }