diff options
author | Vika <vika@fireburn.ru> | 2024-08-26 15:22:29 +0300 |
---|---|---|
committer | Vika <vika@fireburn.ru> | 2024-08-26 15:23:22 +0300 |
commit | 31a0bdad439a4575c1686f690e9e72bd44dde472 (patch) | |
tree | 6b8c9132c19445d997bd75964604b069ffbd573f /src/tokenauth.rs | |
parent | c79e950ca22c7a957c11e510700664327b042115 (diff) | |
download | kittybox-31a0bdad439a4575c1686f690e9e72bd44dde472.tar.zst |
Add HTTP fetcher cache
It just does its thing in the background, potentially speeding up things. Maybe I could also use the underlying in-memory cache implementation (Moka) to speed up my database. I heard crates.io got some good results from that.
Diffstat (limited to 'src/tokenauth.rs')
-rw-r--r-- | src/tokenauth.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/tokenauth.rs b/src/tokenauth.rs index 244a045..414454a 100644 --- a/src/tokenauth.rs +++ b/src/tokenauth.rs @@ -173,7 +173,7 @@ where let Extension(TokenEndpoint(token_endpoint)): Extension<TokenEndpoint> = Extension::from_request(req).await.unwrap(); - let Extension(http): Extension<reqwest::Client> = + let Extension(http): Extension<reqwest_middleware::ClientWithMiddleware> = Extension::from_request(req).await.unwrap(); match http @@ -253,8 +253,8 @@ mod tests { } #[inline] - fn get_http_client() -> reqwest::Client { - reqwest::Client::new() + fn get_http_client() -> reqwest_middleware::ClientWithMiddleware { + reqwest_middleware::ClientWithMiddleware::new() } fn request<A: Into<Option<&'static str>>>( |