From c73efcc95bfe856cb60e30e0c37141f41c09062d Mon Sep 17 00:00:00 2001 From: StellarisW Date: Thu, 31 Oct 2024 15:46:24 +0800 Subject: [PATCH] feat(http): add cookie for client --- volo-http/src/client/mod.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/volo-http/src/client/mod.rs b/volo-http/src/client/mod.rs index 4786c842..896224ad 100644 --- a/volo-http/src/client/mod.rs +++ b/volo-http/src/client/mod.rs @@ -964,9 +964,11 @@ mod client_tests { dns::{parse_target, DnsResolver}, get, Client, DefaultClient, Target, }; + #[cfg(feature = "cookie")] + use crate::client::cookie::CookieLayer; use crate::{ - body::BodyConversion, client::cookie::CookieLayer, error::client::status_error, - response::ResponseExt, utils::consts::HTTP_DEFAULT_PORT, ClientBuilder, + body::BodyConversion, error::client::status_error, response::ResponseExt, + utils::consts::HTTP_DEFAULT_PORT, ClientBuilder, }; #[derive(Deserialize)] @@ -1286,6 +1288,7 @@ mod client_tests { assert!(resp.is_ok()); } + #[cfg(feature = "cookie")] #[tokio::test] async fn cookie_store() { let mut builder = Client::builder().layer_inner(CookieLayer::new(Default::default()));