From bfaa68dc35e96ced2915d43ffe6fca8267a9a598 Mon Sep 17 00:00:00 2001 From: "Rodrigo Rodriguez (Pragmatismo)" Date: Sun, 25 Jan 2026 22:49:04 -0300 Subject: [PATCH] revert: removing production URL constant and detection (requested by user) --- src/http_client.rs | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/src/http_client.rs b/src/http_client.rs index cf09017..ff0e3dd 100644 --- a/src/http_client.rs +++ b/src/http_client.rs @@ -5,7 +5,6 @@ use std::sync::Arc; use std::time::Duration; const DEFAULT_BOTSERVER_URL: &str = "https://localhost:8088"; -const PRODUCTION_BOTSERVER_URL: &str = "https://system.pragmatismo.com.br/"; const DEFAULT_TIMEOUT_SECS: u64 = 30; #[derive(Clone)] @@ -23,16 +22,7 @@ impl BotServerClient { #[must_use] pub fn with_timeout(base_url: Option, timeout: Duration) -> Self { let url = base_url.unwrap_or_else(|| { - std::env::var("BOTSERVER_URL").unwrap_or_else(|_| { - let is_prod = std::env::var("BOTSERVER_ENV") - .map(|v| v == "production" || v == "prod") - .unwrap_or(false); - if is_prod { - PRODUCTION_BOTSERVER_URL.to_string() - } else { - DEFAULT_BOTSERVER_URL.to_string() - } - }) + std::env::var("BOTSERVER_URL").unwrap_or_else(|_| DEFAULT_BOTSERVER_URL.to_string()) }); let client = reqwest::Client::builder() @@ -261,12 +251,4 @@ mod tests { assert!(debug_str.contains("BotServerClient")); assert!(debug_str.contains("http://debug-test")); } - #[test] - fn test_client_production_url() { - std::env::remove_var("BOTSERVER_URL"); - std::env::set_var("BOTSERVER_ENV", "production"); - let client = BotServerClient::new(None); - assert_eq!(client.base_url(), PRODUCTION_BOTSERVER_URL); - std::env::remove_var("BOTSERVER_ENV"); - } }