diff --git a/http-signature-normalization-reqwest/Cargo.toml b/http-signature-normalization-reqwest/Cargo.toml index d2f848e..94dace6 100644 --- a/http-signature-normalization-reqwest/Cargo.toml +++ b/http-signature-normalization-reqwest/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "http-signature-normalization-reqwest" description = "An HTTP Signatures library that leaves the signing to you" -version = "0.1.2" +version = "0.1.3" authors = ["asonix "] license-file = "LICENSE" readme = "README.md" diff --git a/http-signature-normalization-reqwest/README.md b/http-signature-normalization-reqwest/README.md index 46d0412..ca00781 100644 --- a/http-signature-normalization-reqwest/README.md +++ b/http-signature-normalization-reqwest/README.md @@ -14,7 +14,7 @@ This crate provides extensions the RequestBuilder type from reqwest #### First, add this crate to your dependencies ```toml thiserror = "0.1" -http-signature-normalization-reqwest = { version = "0.1.1", default-features = false, features = ["sha-2"] } +http-signature-normalization-reqwest = { version = "0.1.3", default-features = false, features = ["sha-2"] } sha2 = "0.9" ``` diff --git a/http-signature-normalization-reqwest/src/digest/mod.rs b/http-signature-normalization-reqwest/src/digest/mod.rs index 3c475d1..a650efb 100644 --- a/http-signature-normalization-reqwest/src/digest/mod.rs +++ b/http-signature-normalization-reqwest/src/digest/mod.rs @@ -105,7 +105,12 @@ impl SignExt for RequestBuilder { Self: Sized, { Box::pin(async move { - let digest = tokio::task::block_in_place(|| digest.compute(v.as_ref())); + let (v, digest) = tokio::task::spawn_blocking(move || { + let digest = digest.compute(v.as_ref()); + (v, digest) + }) + .await + .map_err(|_| SignError::Canceled)?; let c = self .header("Digest", format!("{}={}", D::NAME, digest))