mirror of
https://git.asonix.dog/asonix/http-signature-normalization.git
synced 2024-11-22 01:11:00 +00:00
Switch other spawn blocking call oops
This commit is contained in:
parent
88a7ecce0d
commit
ce881b18e1
3 changed files with 8 additions and 3 deletions
|
@ -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 <asonix@asonix.dog>"]
|
||||
license-file = "LICENSE"
|
||||
readme = "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"
|
||||
```
|
||||
|
||||
|
|
|
@ -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))
|
||||
|
|
Loading…
Reference in a new issue