From e1e7e529feda438b5cc02b79b9c202b3c68997c4 Mon Sep 17 00:00:00 2001 From: paulobressan Date: Sat, 16 Nov 2024 16:48:13 -0300 Subject: [PATCH] fix: fixed proxy api key --- proxy/src/proxy.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/proxy/src/proxy.rs b/proxy/src/proxy.rs index 04f3d01..96e1e83 100644 --- a/proxy/src/proxy.rs +++ b/proxy/src/proxy.rs @@ -82,13 +82,11 @@ impl ScrollsProxy { .unwrap(); let captures = self.host_regex.captures(host).unwrap(); - let mut key = session + let key = session .get_header(DMTR_API_KEY) - .map(|v| v.to_str().unwrap()) + .and_then(|v| v.to_str().ok()) + .or_else(|| captures.get(1).map(|v| v.as_str())) .unwrap_or_default(); - if let Some(m) = captures.get(1) { - key = m.as_str(); - } key.to_string() }