mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-08-28 22:27:21 +02:00
feat(settings): add HTTP version as an inherited request setting (#609)
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
6777003b70
commit
b7b8ae5f94
@@ -28,7 +28,10 @@ impl HttpConnectionManager {
|
||||
|
||||
pub async fn get_client(&self, opt: &HttpConnectionOptions) -> Result<CachedClient> {
|
||||
let mut connections = self.connections.write().await;
|
||||
let id = opt.id.clone();
|
||||
// The key must include any per-request option that changes how the
|
||||
// client is built, or a send after a settings change reuses a client
|
||||
// built with the old value for up to the cache TTL.
|
||||
let id = format!("{}::{}::{}", opt.id, opt.validate_certificates, opt.http_version);
|
||||
|
||||
// Clean old connections
|
||||
connections.retain(|_, (_, last_used)| last_used.elapsed() <= self.ttl);
|
||||
|
||||
Reference in New Issue
Block a user