From 95ba3117311a00b3aefa8638e6a80831703f02a5 Mon Sep 17 00:00:00 2001 From: Max Burke Date: Mon, 31 Jul 2023 21:03:16 -0700 Subject: [PATCH] Do not add timeout header if it has already been added --- sdk/core/src/request_options/timeout.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sdk/core/src/request_options/timeout.rs b/sdk/core/src/request_options/timeout.rs index a60c7ae5c0..c629d25993 100644 --- a/sdk/core/src/request_options/timeout.rs +++ b/sdk/core/src/request_options/timeout.rs @@ -12,6 +12,10 @@ impl Timeout { impl AppendToUrlQuery for Timeout { fn append_to_url_query(&self, url: &mut url::Url) { + if url.query_pairs().any(|(k, _)| k == "timeout") { + return; + } + url.query_pairs_mut() .append_pair("timeout", &format!("{}", self.0.as_secs())); }