summaryrefslogtreecommitdiff
path: root/ext/fetch/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'ext/fetch/lib.rs')
-rw-r--r--ext/fetch/lib.rs18
1 files changed, 7 insertions, 11 deletions
diff --git a/ext/fetch/lib.rs b/ext/fetch/lib.rs
index 6a2ac2ef9..ee8f30b59 100644
--- a/ext/fetch/lib.rs
+++ b/ext/fetch/lib.rs
@@ -789,13 +789,6 @@ impl HttpClientResource {
}
}
-#[derive(Deserialize, Debug, Clone)]
-#[serde(rename_all = "camelCase")]
-pub enum PoolIdleTimeout {
- State(bool),
- Specify(u64),
-}
-
#[derive(Deserialize, Debug)]
#[serde(rename_all = "camelCase")]
pub struct CreateHttpClientArgs {
@@ -804,7 +797,7 @@ pub struct CreateHttpClientArgs {
cert_chain: Option<String>,
private_key: Option<String>,
pool_max_idle_per_host: Option<usize>,
- pool_idle_timeout: Option<PoolIdleTimeout>,
+ pool_idle_timeout: Option<serde_json::Value>,
#[serde(default = "default_true")]
http1: bool,
#[serde(default = "default_true")]
@@ -867,9 +860,12 @@ where
pool_max_idle_per_host: args.pool_max_idle_per_host,
pool_idle_timeout: args.pool_idle_timeout.and_then(
|timeout| match timeout {
- PoolIdleTimeout::State(true) => None,
- PoolIdleTimeout::State(false) => Some(None),
- PoolIdleTimeout::Specify(specify) => Some(Some(specify)),
+ serde_json::Value::Bool(true) => None,
+ serde_json::Value::Bool(false) => Some(None),
+ serde_json::Value::Number(specify) => {
+ Some(Some(specify.as_u64().unwrap_or_default()))
+ }
+ _ => Some(None),
},
),
http1: args.http1,